(self)
| 644 | self.assert_(getattr(MyList, "_sa_instrumented") == id(MyList)) |
| 645 | |
| 646 | def test_list_duck(self): |
| 647 | class ListLike: |
| 648 | def __init__(self): |
| 649 | self.data = list() |
| 650 | |
| 651 | def append(self, item): |
| 652 | self.data.append(item) |
| 653 | |
| 654 | def remove(self, item): |
| 655 | self.data.remove(item) |
| 656 | |
| 657 | def insert(self, index, item): |
| 658 | self.data.insert(index, item) |
| 659 | |
| 660 | def pop(self, index=-1): |
| 661 | return self.data.pop(index) |
| 662 | |
| 663 | def extend(self): |
| 664 | assert False |
| 665 | |
| 666 | def __iter__(self): |
| 667 | return iter(self.data) |
| 668 | |
| 669 | __hash__ = object.__hash__ |
| 670 | |
| 671 | def __eq__(self, other): |
| 672 | return self.data == other |
| 673 | |
| 674 | def __repr__(self): |
| 675 | return "ListLike(%s)" % repr(self.data) |
| 676 | |
| 677 | self._test_adapter(ListLike) |
| 678 | self._test_list(ListLike) |
| 679 | self._test_list_bulk(ListLike) |
| 680 | self.assert_(getattr(ListLike, "_sa_instrumented") == id(ListLike)) |
| 681 | |
| 682 | def test_list_emulates(self): |
| 683 | class ListIsh: |
nothing calls this directly
no test coverage detected