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

Function TestConvertFileObject

cli/compose/convert/service_test.go:462–484  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

460}
461
462func TestConvertFileObject(t *testing.T) {
463 namespace := NewNamespace("testing")
464 config := composetypes.FileReferenceConfig{
465 Source: "source",
466 Target: "target",
467 UID: "user",
468 GID: "group",
469 Mode: uint32Ptr(0o644),
470 }
471 swarmRef, err := convertFileObject(namespace, config, lookupConfig)
472 assert.NilError(t, err)
473
474 expected := swarmReferenceObject{
475 Name: "testing_source",
476 File: swarmReferenceTarget{
477 Name: config.Target,
478 UID: config.UID,
479 GID: config.GID,
480 Mode: os.FileMode(0o644),
481 },
482 }
483 assert.Check(t, is.DeepEqual(expected, swarmRef))
484}
485
486func lookupConfig(key string) (composetypes.FileObjectConfig, error) {
487 if key != "source" {

Callers

nothing calls this directly

Calls 3

NewNamespaceFunction · 0.85
convertFileObjectFunction · 0.85
uint32PtrFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…