コード例 #1
0
 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)
コード例 #2
0
 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')
コード例 #3
0
 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)