(self)
| 49 | self.assertEqual(u[:],u) |
| 50 | |
| 51 | def test_mixed_add(self): |
| 52 | for t in UserList, list, str, tuple, iter: |
| 53 | with self.subTest(t.__name__): |
| 54 | u = UserList("spam") + t("eggs") |
| 55 | self.assertEqual(u, list("spameggs")) |
| 56 | self.assertIs(type(u), UserList) |
| 57 | |
| 58 | u = t("spam") + UserList("eggs") |
| 59 | self.assertEqual(u, list("spameggs")) |
| 60 | self.assertIs(type(u), UserList) |
| 61 | |
| 62 | u = UserList("spam") + UserListSubclass("eggs") |
| 63 | self.assertEqual(u, list("spameggs")) |
| 64 | self.assertIs(type(u), UserList) |
| 65 | |
| 66 | u = UserListSubclass("spam") + UserList("eggs") |
| 67 | self.assertEqual(u, list("spameggs")) |
| 68 | self.assertIs(type(u), UserListSubclass) |
| 69 | |
| 70 | u = UserListSubclass("spam") + UserListSubclass2("eggs") |
| 71 | self.assertEqual(u, list("spameggs")) |
| 72 | self.assertIs(type(u), UserListSubclass) |
| 73 | |
| 74 | u2 = UserList("eggs").__radd__(UserList("spam")) |
| 75 | self.assertEqual(u2, list("spameggs")) |
| 76 | self.assertIs(type(u), UserListSubclass) |
| 77 | |
| 78 | u2 = UserListSubclass("eggs").__radd__(UserListSubclass2("spam")) |
| 79 | self.assertEqual(u2, list("spameggs")) |
| 80 | self.assertIs(type(u), UserListSubclass) |
| 81 | |
| 82 | def test_mixed_iadd(self): |
| 83 | for t in UserList, list, str, tuple, iter: |
nothing calls this directly
no test coverage detected