Tests of == __eq__
(self)
| 853 | self.assertRepr(zero) |
| 854 | |
| 855 | def test_binaryvector_equality(self): |
| 856 | """Tests of == __eq__""" |
| 857 | self.assertEqual( |
| 858 | BinaryVector([1.2, 1 - 1 / 3], BinaryVectorDtype.FLOAT32, 0), |
| 859 | BinaryVector([1.2, 1 - 1.0 / 3.0], BinaryVectorDtype.FLOAT32, 0), |
| 860 | ) |
| 861 | self.assertNotEqual( |
| 862 | BinaryVector([1.2, 1 - 1 / 3], BinaryVectorDtype.FLOAT32, 0), |
| 863 | BinaryVector([1.2, 6.0 / 9.0], BinaryVectorDtype.FLOAT32, 0), |
| 864 | ) |
| 865 | self.assertEqual( |
| 866 | BinaryVector([], BinaryVectorDtype.FLOAT32, 0), |
| 867 | BinaryVector([], BinaryVectorDtype.FLOAT32, 0), |
| 868 | ) |
| 869 | self.assertNotEqual( |
| 870 | BinaryVector([1], BinaryVectorDtype.INT8), BinaryVector([2], BinaryVectorDtype.INT8) |
| 871 | ) |
| 872 | |
| 873 | @unittest.skipIf(not _NUMPY_AVAILABLE, "numpy optional-dependency not installed.") |
| 874 | def test_vector_from_numpy(self): |
nothing calls this directly
no test coverage detected