コード例 #1
0
 def setUp(self, res):
     res.return_value.instances.filter.return_value = public_instances()
     self.manager = EtcdManager()
     self.manager.instance_id = 'i-deadbeef3'
     self.manager.region = 'eu-west-1'
     EtcdCluster.REGIONS = ['eu-west-1', 'eu-central-1']
     self.cluster = EtcdCluster(self.manager)
     self.cluster.load_members()
     self.assertTrue(EtcdCluster.is_multiregion())
コード例 #2
0
 def setUp(self, res):
     res.return_value.instances.filter.return_value = public_instances()
     self.manager = EtcdManager()
     self.manager.instance_id = 'i-deadbeef3'
     self.manager.region = 'eu-west-1'
     EtcdCluster.REGIONS = ['eu-west-1', 'eu-central-1']
     self.cluster = EtcdCluster(self.manager)
     self.cluster.load_members()
     self.assertTrue(EtcdCluster.is_multiregion())
コード例 #3
0
 def test_load_members(self, res):
     res.return_value.instances.filter.return_value = public_instances()
     self.assertEqual(len(self.cluster.members), 7)
     with patch('requests.get', Mock(side_effect=Exception)):
         self.cluster.load_members()
コード例 #4
0
 def test_load_members(self, res):
     res.return_value.instances.filter.return_value = public_instances()
     self.assertEqual(len(self.cluster.members), 7)
     with patch('requests.get', Mock(side_effect=Exception)):
         self.cluster.load_members()