Example #1
0
 def test_container_config(self):
     """
     container_config returns a dictionary representation
     of the LXD container. Verify that the funciton returns
     a container_config
     """
     instance = stubs._fake_instance()
     self.ml.get_container_config.return_value = (200, fake_api.fake_container_config())
     self.assertEqual((200, fake_api.fake_container_config()), self.session.container_config(instance))
Example #2
0
 def test_container_update(self):
     """
     container_update updates the LXD container configuration,
     so verify that the correct pylxd calls are made.
     """
     config = mock.Mock()
     instance = stubs._fake_instance()
     self.ml.container_update.return_value = (200, fake_api.fake_container_config())
     self.assertEqual((200, fake_api.fake_container_config()), self.session.container_update(config, instance))
     calls = [mock.call.container_defined(instance.name), mock.call.container_update(instance.name, config)]
     self.assertEqual(calls, self.ml.method_calls)
Example #3
0
 def test_container_config(self):
     """
     container_config returns a dictionary representation
     of the LXD container. Verify that the funciton returns
     a container_config
     """
     instance = stubs._fake_instance()
     self.ml.get_container_config.return_value = \
         (200, fake_api.fake_container_config())
     self.assertEqual((200, fake_api.fake_container_config()),
                      self.session.container_config(instance))
Example #4
0
 def test_container_update(self):
     """
     container_update updates the LXD container configuration,
     so verify that the correct pylxd calls are made.
     """
     config = mock.Mock()
     instance = stubs._fake_instance()
     self.ml.container_update.return_value = \
         (200, fake_api.fake_container_config())
     self.assertEqual((200, fake_api.fake_container_config()),
                      self.session.container_update(config, instance))
     calls = [
         mock.call.container_defined(instance.name),
         mock.call.container_update(instance.name, config)
     ]
     self.assertEqual(calls, self.ml.method_calls)