def test_alias_to_index_name_no_v1(self): logger = Mock() es = Mock() es.indices.exists_alias.side_effect = [False, True] actual = sut.alias_to_index_name(es, logger, 'peach') self.assertEqual('peach-v2', actual)
def test_alias_to_index_name_neither(self): logger = Mock() es = Mock() es.indices.exists_alias.side_effect = [False, False] with self.assertRaises(SystemExit): sut.alias_to_index_name(es, logger, 'peach')
def test_alias_to_index_name_happy_path(self): logger = Mock() es = Mock() es.indices.exists_alias.side_effect = [True, True] actual = sut.alias_to_index_name(es, logger, 'peach') self.assertEqual('peach-v1', actual)