def test_process_metadata_response_empty(): result = _process_metadata_response( topics={}, zk=None, default_min_isr=None, ) assert result == []
def test_run_command_with_default_min_isr(min_isr_mock): result = _process_metadata_response( topics=TOPICS_STATE, zk=None, default_min_isr=1, ) assert result == []
def test_run_command_all_ok_without_min_isr_in_zk(min_isr_mock): result = _process_metadata_response( topics=TOPICS_STATE, zk=None, default_min_isr=None, ) assert result == []
def test_run_command_all_fail(min_isr_mock): result = _process_metadata_response( topics=TOPICS_STATE, zk=None, default_min_isr=1, ) assert sorted(result) == sorted(NOT_IN_SYNC_PARTITIONS)
def test_run_command_all_fail(min_isr_mock): result = _process_metadata_response( topics=TOPICS_STATE, zk=None, default_min_isr=1, ) def dict_comparator(d): return sorted(d.items()) assert sorted(result, key=dict_comparator) == sorted(NOT_IN_SYNC_PARTITIONS, key=dict_comparator)
def test_run_command_with_fail_with_default_min_isr(min_isr_mock): result = _process_metadata_response( topics=TOPICS_STATE, zk=None, default_min_isr=2, ) p0 = { 'isr': 1, 'min_isr': 2, 'topic': 'topic_0', 'partition': 0, } assert result == [p0]