Beispiel #1
0
 def test_make_list_of_close_matches_returns_empty_list_with_no_close_matches(self):
     self.assertEqual(
         [],
         opts.make_list_of_close_matches(
             ["number_of_shards", "number_of-replicas"],
             [])
     )
Beispiel #2
0
    def test_make_list_of_close_matches(self):
        word_list = [
            "bulk_indexing_clients", "bulk_indexing_iterations",
            "target_throughput", "bulk_size", "number_of-shards",
            "number_of_replicas", "index_refresh_interval"
        ]

        available_word_list = [
            "bulk_indexing_clients", "bulk_indexing_iterations", "bulk_size",
            "cluster_health", "disk_type", "duration", "forcemerge",
            "index_alias", "index_refresh_interval", "indices_delete_pattern",
            "joiner", "max_rolledover_indices", "number_of_replicas",
            "number_of_shards", "ops_per_25_gb", "p1_bulk_indexing_clients",
            "p1_bulk_size", "p1_duration_secs", "p2_bulk_indexing_clients",
            "p2_bulk_size", "p2_duration_secs", "p2_ops",
            "p2_query1_target_interval", "p2_query2_target_interval",
            "p2_query3_target_interval", "p2_query4_target_interval",
            "phase_duration_secs", "pre_filter_shard_size", "query_iterations",
            "range", "rate_limit_duration_secs", "rate_limit_max",
            "rate_limit_step", "rolledover_indices_suffix_separator",
            "rollover_max_age", "rollover_max_size", "shard_sizing_iterations",
            "shard_sizing_queries", "source_enabled", "target_throughput",
            "translog_sync"
        ]

        self.assertEqual(
            [
                'bulk_indexing_clients',
                'bulk_indexing_iterations',
                'target_throughput',
                'bulk_size',
                # number_of-shards had a typo
                'number_of_shards',
                'number_of_replicas',
                'index_refresh_interval'
            ],
            opts.make_list_of_close_matches(word_list, available_word_list))
Beispiel #3
0
 def test_make_list_of_close_matches_returns_with_empty_word_list(self):
     assert opts.make_list_of_close_matches([], ["number_of_shards"]) == []