Skip to content

Commit

Permalink
Merge pull request #1083 from dustin-decker/smaller-space
Browse files Browse the repository at this point in the history
test default case for threshold behavior
  • Loading branch information
untergeek committed Oct 13, 2017
2 parents 82b547a + 72475ef commit 12e16d5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/unit/test_class_index_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,18 +624,26 @@ def test_filter_threshold_behavior(self):
client.cluster.state.return_value = testvars.clu_state_two
client.indices.stats.return_value = testvars.stats_two
client.field_stats.return_value = testvars.fieldstats_two
il = curator.IndexList(client)
il.filter_by_space(
# less than
il_a = curator.IndexList(client)
il_a.filter_by_space(
disk_space=1.5, use_age=True,
threshold_behavior='less_than'
)
self.assertEqual(['index-2016.03.04'], sorted(il.indices))
self.assertEqual(['index-2016.03.04'], sorted(il_a.indices))
# greater than
il_b = curator.IndexList(client)
il_b.filter_by_space(
disk_space=1.5, use_age=True,
threshold_behavior='greater_than'
)
self.assertEqual(['index-2016.03.03'], sorted(il_b.indices))
# default case
il_c = curator.IndexList(client)
il_c.filter_by_space(
disk_space=1.5, use_age=True
)
self.assertEqual(['index-2016.03.03'], sorted(il_c.indices))
def test_filter_result_by_date_field_stats_raise(self):
client = Mock()
client.info.return_value = {'version': {'number': '5.0.0'} }
Expand Down

0 comments on commit 12e16d5

Please sign in to comment.