Beispiel #1
0
class TestNovaCollector(base.TestCase):
    @mock.patch('keystoneclient.v3.client.Client')
    def setUp(self, mock_ksclient):
        super(TestNovaCollector, self).setUp()
        self.wrapper = mock.MagicMock()
        self.nova_collector = NovaClusterModelCollector(self.wrapper)

    def test_nova_collector(self):
        hypervisor = mock.Mock()
        hypervisor.hypervisor_hostname = "rdev-lannion.eu"
        hypervisor.service = mock.MagicMock()
        service = mock.Mock()
        service.host = ""
        self.wrapper.get_hypervisors_list.return_value = {hypervisor}
        self.wrapper.nova.services.find.get.return_value = service
        model = self.nova_collector.get_latest_cluster_data_model()
        self.assertIsNotNone(model)
class TestNovaCollector(base.TestCase):
    @mock.patch('keystoneclient.v3.client.Client')
    def setUp(self, mock_ksclient):
        super(TestNovaCollector, self).setUp()
        self.wrapper = mock.MagicMock()
        self.nova_collector = NovaClusterModelCollector(self.wrapper)

    def test_nova_collector(self):
        hypervisor = mock.Mock()
        hypervisor.hypervisor_hostname = "rdev-lannion.eu"
        hypervisor.service = mock.MagicMock()
        service = mock.Mock()
        service.host = ""
        self.wrapper.get_hypervisors_list.return_value = {hypervisor}
        self.wrapper.nova.services.find.get.return_value = service
        model = self.nova_collector.get_latest_cluster_data_model()
        self.assertIsNotNone(model)
Beispiel #3
0
 def setUp(self, mock_ksclient):
     super(TestNovaCollector, self).setUp()
     self.wrapper = mock.MagicMock()
     self.nova_collector = NovaClusterModelCollector(self.wrapper)
 def setUp(self, mock_ksclient):
     super(TestNovaCollector, self).setUp()
     self.wrapper = mock.MagicMock()
     self.nova_collector = NovaClusterModelCollector(self.wrapper)