예제 #1
0
 def test_should_delete(self):
     self.assertEqual(
         False,
         glance.Images(self.creds_manager).should_delete({'owner': 84}))
     self.assertEqual(
         True,
         glance.Images(self.creds_manager).should_delete({'owner': 42}))
예제 #2
0
 def test_to_string(self):
     image = mock.MagicMock()
     self.assertIn("Image (",
                   glance.Images(self.creds_manager).to_str(image))
예제 #3
0
 def test_delete(self):
     image = mock.MagicMock()
     self.assertIsNone(glance.Images(self.creds_manager).delete(image))
     self.cloud.delete_image.assert_called_once_with(image['id'])
예제 #4
0
 def test_list(self, mock_list_images_by_owner):
     self.assertIs(mock_list_images_by_owner.return_value,
                   glance.Images(self.creds_manager).list())
     mock_list_images_by_owner.assert_called_once_with()