(t *testing.T)
| 148 | } |
| 149 | |
| 150 | func TestMemoryQuery(t *testing.T) { |
| 151 | var tests = []struct { |
| 152 | desc string |
| 153 | xlen int |
| 154 | namespace string |
| 155 | lbs map[string]string |
| 156 | }{ |
| 157 | { |
| 158 | "should be 2 query results", |
| 159 | 2, |
| 160 | "default", |
| 161 | map[string]string{"status": "deployed"}, |
| 162 | }, |
| 163 | { |
| 164 | "should be 1 query result", |
| 165 | 1, |
| 166 | "mynamespace", |
| 167 | map[string]string{"status": "deployed"}, |
| 168 | }, |
| 169 | } |
| 170 | |
| 171 | ts := tsFixtureMemory(t) |
| 172 | for _, tt := range tests { |
| 173 | ts.SetNamespace(tt.namespace) |
| 174 | l, err := ts.Query(tt.lbs) |
| 175 | if err != nil { |
| 176 | t.Fatalf("Failed to query: %s\n", err) |
| 177 | } |
| 178 | |
| 179 | if tt.xlen != len(l) { |
| 180 | t.Fatalf("Expected %d results, actual %d\n", tt.xlen, len(l)) |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | func TestMemoryUpdate(t *testing.T) { |
| 186 | var tests = []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…