MCPcopy
hub / github.com/nektos/act / TestParseLoggingOpts

Function TestParseLoggingOpts

pkg/container/docker_cli_test.go:932–945  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

930}
931
932func TestParseLoggingOpts(t *testing.T) {
933 // logging opts ko
934 if _, _, _, err := parseRun([]string{"--log-driver=none", "--log-opt=anything", "img", "cmd"}); err == nil || err.Error() != "invalid logging opts for driver none" {
935 t.Fatalf("Expected an error with message 'invalid logging opts for driver none', got %v", err)
936 }
937 // logging opts ok
938 _, hostconfig, _, err := parseRun([]string{"--log-driver=syslog", "--log-opt=something", "img", "cmd"})
939 if err != nil {
940 t.Fatal(err)
941 }
942 if hostconfig.LogConfig.Type != "syslog" || len(hostconfig.LogConfig.Config) != 1 {
943 t.Fatalf("Expected a 'syslog' LogConfig with one config, got %v", hostconfig.RestartPolicy)
944 }
945}
946
947func TestParseEnvfileVariables(t *testing.T) {
948 e := "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…