MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_binaryvector_equality

Method test_binaryvector_equality

test/test_bson.py:855–871  ·  view source on GitHub ↗

Tests of == __eq__

(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 1

BinaryVectorClass · 0.90

Tested by

no test coverage detected