(self)
| 182 | self.assertEqual(dictionary['a'], res) |
| 183 | |
| 184 | def test_lists(self): |
| 185 | # Testing list operations... |
| 186 | # Asserts are within individual test methods |
| 187 | self.binop_test([1], [2], [1,2], "a+b", "__add__") |
| 188 | self.binop_test([1,2,3], 2, 1, "b in a", "__contains__") |
| 189 | self.binop_test([1,2,3], 4, 0, "b in a", "__contains__") |
| 190 | self.binop_test([1,2,3], 1, 2, "a[b]", "__getitem__") |
| 191 | self.sliceop_test([1,2,3], 0, 2, [1,2], "a[b:c]", "__getitem__") |
| 192 | self.setop_test([1], [2], [1,2], "a+=b", "__iadd__") |
| 193 | self.setop_test([1,2], 3, [1,2,1,2,1,2], "a*=b", "__imul__") |
| 194 | self.unop_test([1,2,3], 3, "len(a)", "__len__") |
| 195 | self.binop_test([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__") |
| 196 | self.binop_test([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__") |
| 197 | self.set2op_test([1,2], 1, 3, [1,3], "a[b]=c", "__setitem__") |
| 198 | self.setsliceop_test([1,2,3,4], 1, 3, [5,6], [1,5,6,4], "a[b:c]=d", |
| 199 | "__setitem__") |
| 200 | |
| 201 | def test_dicts(self): |
| 202 | # Testing dict operations... |
nothing calls this directly
no test coverage detected