Commit 6bce67d
committed
fix(types): make test classes implement Mapping protocol
why: Mypy was reporting type errors because test classes were not properly implementing the Mapping protocol
what:
- Added proper Mapping[str, Any] implementation to Food, Restaurant, and Item classes
- Implemented __getitem__, __iter__, and __len__ methods
- Used typing.cast for non-mapping test case
- Fixed type hints in test_query_list_attributes1 parent 9638226 commit 6bce67dCopy full SHA for 6bce67d
File tree
Expand file treeCollapse file tree
1 file changed
+52
-22
lines changedOpen diff view settings
Filter options
- tests/_internal
Expand file treeCollapse file tree
1 file changed
+52
-22
lines changedOpen diff view settings
Collapse file
tests/_internal/test_query_list.py
Copy file name to clipboardExpand all lines: tests/_internal/test_query_list.py+52-22Lines changed: 52 additions & 22 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
698 | 698 | |
699 | 699 | |
700 | 700 | |
701 | | - |
702 | | - |
| 701 | + |
| 702 | + |
| 703 | + |
| 704 | + |
703 | 705 | |
704 | | - |
705 | | - |
706 | | - |
707 | | - |
| 706 | + |
| 707 | + |
708 | 708 | |
709 | | - |
710 | | - |
711 | | - |
712 | | - |
713 | | - |
714 | | - |
| 709 | + |
| 710 | + |
| 711 | + |
| 712 | + |
| 713 | + |
| 714 | + |
| 715 | + |
| 716 | + |
| 717 | + |
| 718 | + |
| 719 | + |
| 720 | + |
| 721 | + |
| 722 | + |
| 723 | + |
| 724 | + |
715 | 725 | |
716 | | - |
| 726 | + |
| 727 | + |
| 728 | + |
| 729 | + |
| 730 | + |
| 731 | + |
| 732 | + |
| 733 | + |
| 734 | + |
| 735 | + |
717 | 736 | |
718 | 737 | |
719 | 738 | |
| ||
736 | 755 | |
737 | 756 | |
738 | 757 | |
739 | | - |
| 758 | + |
| 759 | + |
| 760 | + |
740 | 761 | |
741 | 762 | |
742 | 763 | |
| ||
773 | 794 | |
774 | 795 | |
775 | 796 | |
776 | | - |
| 797 | + |
777 | 798 | |
778 | 799 | |
779 | 800 | |
| 801 | + |
| 802 | + |
| 803 | + |
| 804 | + |
| 805 | + |
| 806 | + |
| 807 | + |
| 808 | + |
| 809 | + |
780 | 810 | |
781 | | - |
782 | | - |
783 | | - |
| 811 | + |
| 812 | + |
| 813 | + |
784 | 814 | |
785 | 815 | |
786 | | - |
| 816 | + |
787 | 817 | |
788 | | - |
| 818 | + |
789 | 819 | |
790 | 820 | |
791 | | - |
| 821 | + |
792 | 822 | |
793 | | - |
| 823 | + |
794 | 824 | |
795 | 825 | |
796 | 826 | |
|
0 commit comments