MCPcopy
hub / github.com/slimtoolkit/slim / assertTargetAppStdFileEqualsTo

Method assertTargetAppStdFileEqualsTo

pkg/test/e2e/sensor/sensor.go:714–733  ·  view source on GitHub ↗
(
	t *testing.T,
	ctx context.Context,
	kind string,
	expected string,
)

Source from the content-addressed store, hash-verified

712}
713
714func (s *Sensor) assertTargetAppStdFileEqualsTo(
715 t *testing.T,
716 ctx context.Context,
717 kind string,
718 expected string,
719) {
720 if len(s.contID) == 0 {
721 t.Fatal("Test sensor container hasn't been started yet")
722 }
723
724 data, err := os.ReadFile(filepath.Join(s.localArtifactsDirPath(), kind))
725 if err != nil {
726 t.Fatalf("cannot read %s file: %v", kind, err)
727 }
728
729 actual := strings.TrimSpace(string(data))
730 if actual != expected {
731 t.Errorf("Unexpected target app %s content %q. Expected %q.", kind, actual, expected)
732 }
733}
734
735// Checks the presense of the expected events AND the occurrence order.
736func (s *Sensor) AssertSensorEventsFileContains(

Calls 1

localArtifactsDirPathMethod · 0.95

Tested by

no test coverage detected