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

Class TestReadPreferenceObjects

test/test_read_preferences.py:81–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80
81class TestReadPreferenceObjects(unittest.TestCase):
82 prefs = [
83 Primary(),
84 PrimaryPreferred(),
85 Secondary(),
86 Nearest(tag_sets=[{"a": 1}, {"b": 2}]),
87 SecondaryPreferred(max_staleness=30),
88 ]
89
90 def test_pickle(self):
91 for pref in self.prefs:
92 self.assertEqual(pref, pickle.loads(pickle.dumps(pref)))
93
94 def test_copy(self):
95 for pref in self.prefs:
96 self.assertEqual(pref, copy.copy(pref))
97
98 def test_deepcopy(self):
99 for pref in self.prefs:
100 self.assertEqual(pref, copy.deepcopy(pref))
101
102
103class TestReadPreferencesBase(IntegrationTest):

Callers

nothing calls this directly

Calls 5

PrimaryClass · 0.90
PrimaryPreferredClass · 0.90
SecondaryClass · 0.90
NearestClass · 0.90
SecondaryPreferredClass · 0.90

Tested by

no test coverage detected