def test_local_threshold(self):
        client = connected(self.mock_client(localThresholdMS=30))
        self.assertEqual(30, client.local_threshold_ms)
        wait_until(lambda: len(client.nodes) == 3, 'connect to all mongoses')
        topology = client._topology

        # All are within a 30-ms latency window, see self.mock_client().
        self.assertEqual(set([('a', 1), ('b', 2), ('c', 3)]),
                         writable_addresses(topology))

        # No error
        client.admin.command('ismaster')

        client = connected(self.mock_client(localThresholdMS=0))
        self.assertEqual(0, client.local_threshold_ms)
        # No error
        client.db.command('ismaster')
        # Our chosen mongos goes down.
        client.kill_host(next(iter(client.nodes)) % '%s:%s')
        try:
            client.db.command('ismaster')
        except:
            pass
        # No error
        client.db.command('ismaster')
dataset/ETHPy150Open mongodb/mongo-python-driver/test/test_mongos_load_balancing.py/TestMongosLoadBalancing.test_local_threshold/swapped operands of `%`