(t *testing.T)
| 460 | } |
| 461 | |
| 462 | func 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 | |
| 486 | func lookupConfig(key string) (composetypes.FileObjectConfig, error) { |
| 487 | if key != "source" { |
nothing calls this directly
no test coverage detected
searching dependent graphs…