MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_clears

Method test_clears

test/test_son.py:154–161  ·  view source on GitHub ↗

Test clear()

(self)

Source from the content-addressed store, hash-verified

152 self.assertNotIn(22, test_son, "in succeeded when it shouldn't")
153
154 def test_clears(self):
155 """Test clear()"""
156 test_son = SON([(1, 100), (2, 200), (3, 300)])
157 test_son.clear()
158 self.assertNotIn(1, test_son)
159 self.assertEqual(0, len(test_son))
160 self.assertEqual(0, len(test_son.keys()))
161 self.assertEqual({}, test_son.to_dict())
162
163 def test_len(self):
164 """Test len"""

Callers

nothing calls this directly

Calls 4

clearMethod · 0.95
to_dictMethod · 0.95
SONClass · 0.90
keysMethod · 0.80

Tested by

no test coverage detected