MCPcopy Index your code
hub / github.com/docker/cli / TestParseLoggingOpts

Function TestParseLoggingOpts

cli/command/container/opts_test.go:927–940  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

925}
926
927func TestParseLoggingOpts(t *testing.T) {
928 // logging opts ko
929 if _, _, _, err := parseRun([]string{"--log-driver=none", "--log-opt=anything", "img", "cmd"}); err == nil || err.Error() != "invalid logging opts for driver none" {
930 t.Fatalf("Expected an error with message 'invalid logging opts for driver none', got %v", err)
931 }
932 // logging opts ok
933 _, hostconfig, _, err := parseRun([]string{"--log-driver=syslog", "--log-opt=something", "img", "cmd"})
934 if err != nil {
935 t.Fatal(err)
936 }
937 if hostconfig.LogConfig.Type != "syslog" || len(hostconfig.LogConfig.Config) != 1 {
938 t.Fatalf("Expected a 'syslog' LogConfig with one config, got %v", hostconfig.RestartPolicy)
939 }
940}
941
942func TestParseEnvfileVariables(t *testing.T) {
943 expErr := "--env-file: open nonexistent: no such file or directory"

Callers

nothing calls this directly

Calls 2

parseRunFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…