Tests of repr(BinaryVector)
(self)
| 818 | self.assertEqual(repr(new_obj), repr(obj)) |
| 819 | |
| 820 | def test_binaryvector_repr(self): |
| 821 | """Tests of repr(BinaryVector)""" |
| 822 | |
| 823 | data = [1 / 127, -7 / 6] |
| 824 | one = BinaryVector(data, BinaryVectorDtype.FLOAT32) |
| 825 | self.assertEqual( |
| 826 | repr(one), f"BinaryVector(dtype=BinaryVectorDtype.FLOAT32, padding=0, data={data})" |
| 827 | ) |
| 828 | self.assertRepr(one) |
| 829 | |
| 830 | data = [127, 7] |
| 831 | two = BinaryVector(data, BinaryVectorDtype.INT8) |
| 832 | self.assertEqual( |
| 833 | repr(two), f"BinaryVector(dtype=BinaryVectorDtype.INT8, padding=0, data={data})" |
| 834 | ) |
| 835 | self.assertRepr(two) |
| 836 | |
| 837 | three = BinaryVector(data, BinaryVectorDtype.INT8, padding=0) |
| 838 | self.assertEqual( |
| 839 | repr(three), f"BinaryVector(dtype=BinaryVectorDtype.INT8, padding=0, data={data})" |
| 840 | ) |
| 841 | self.assertRepr(three) |
| 842 | |
| 843 | four = BinaryVector(data, BinaryVectorDtype.PACKED_BIT, padding=3) |
| 844 | self.assertEqual( |
| 845 | repr(four), f"BinaryVector(dtype=BinaryVectorDtype.PACKED_BIT, padding=3, data={data})" |
| 846 | ) |
| 847 | self.assertRepr(four) |
| 848 | |
| 849 | zero = BinaryVector([], BinaryVectorDtype.INT8) |
| 850 | self.assertEqual( |
| 851 | repr(zero), "BinaryVector(dtype=BinaryVectorDtype.INT8, padding=0, data=[])" |
| 852 | ) |
| 853 | self.assertRepr(zero) |
| 854 | |
| 855 | def test_binaryvector_equality(self): |
| 856 | """Tests of == __eq__""" |
nothing calls this directly
no test coverage detected