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}))
def test_to_string(self): image = mock.MagicMock() self.assertIn("Image (", glance.Images(self.creds_manager).to_str(image))
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'])
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()