

def _test_tokenaware_one_node_down(self, keyspace, rf, accepted):
    cluster = Cluster(load_balancing_policy=TokenAwarePolicy(RoundRobinPolicy()), protocol_version=PROTOCOL_VERSION)
    session = cluster.connect()
    wait_for_up(cluster, 1, wait=False)
    wait_for_up(cluster, 2)
    create_schema(cluster, session, keyspace, replication_factor=rf)
    self._insert(session, keyspace, count=1)
    self._query(session, keyspace, count=1)
    self.coordinator_stats.assert_query_count_equals(self, 1, 0)
    self.coordinator_stats.assert_query_count_equals(self, 2, 1)
    self.coordinator_stats.assert_query_count_equals(self, 3, 0)
    try:
        force_stop(2)
        wait_for_down(cluster, 2)
        self._assert_writes_succeed(session, keyspace, accepted)
        self._assert_reads_succeed(session, keyspace, (accepted - set([ConsistencyLevel.ANY])))
        self._assert_writes_fail(session, keyspace, (SINGLE_DC_CONSISTENCY_LEVELS - accepted))
        self._assert_reads_fail(session, keyspace, (SINGLE_DC_CONSISTENCY_LEVELS - accepted))
    finally:
        start(2)
        wait_for_up(cluster, 2)
    cluster.shutdown()

dataset/ETHPy150Open datastax/python-driver/tests/integration/long/test_consistency.py ConsistencyTests._test_tokenaware_one_node_down/original