LoadFixtureFile loads connections from a JSON fixture file
(t *testing.T, filePath string)
| 75 | |
| 76 | // LoadFixtureFile loads connections from a JSON fixture file |
| 77 | func LoadFixtureFile(t *testing.T, filePath string) []collector.Connection { |
| 78 | mock, err := collector.NewMockCollectorFromFile(filePath) |
| 79 | if err != nil { |
| 80 | t.Fatalf("Failed to load fixture file %s: %v", filePath, err) |
| 81 | } |
| 82 | |
| 83 | connections, err := mock.GetConnections() |
| 84 | if err != nil { |
| 85 | t.Fatalf("Failed to get connections from fixture: %v", err) |
| 86 | } |
| 87 | |
| 88 | return connections |
| 89 | } |
| 90 | |
| 91 | // AssertConnectionsEqual compares two slices of connections for equality |
| 92 | func AssertConnectionsEqual(t *testing.T, expected, actual []collector.Connection) { |
nothing calls this directly
no test coverage detected