Add a test for deleting a plan with a bad UUID

Change-Id: Ide91fd1269041cdd8da6e6635a441e478332660a
This commit is contained in:
Dougal Matthews 2014-08-21 12:41:32 +01:00
parent c668d194c8
commit 4c659aa2b9

View File

@ -108,6 +108,19 @@ class PlansTests(base.TestCase):
mock_delete.assert_called_once_with('qwerty12345') mock_delete.assert_called_once_with('qwerty12345')
self.assertEqual(response.status_int, 204) self.assertEqual(response.status_int, 204)
@mock.patch('tuskar.manager.plan.PlansManager.delete_plan')
def test_delete_invalid_uuid(self, mock_delete):
# Setup
mock_delete.side_effect = storage_exceptions.UnknownUUID()
# Test
url = URL_PLANS + '/' + 'qwerty12345'
response = self.app.delete(url, status=404)
# Verify
mock_delete.assert_called_once_with('qwerty12345')
self.assertEqual(response.status_int, 404)
@mock.patch('tuskar.manager.plan.PlansManager.create_plan') @mock.patch('tuskar.manager.plan.PlansManager.create_plan')
def test_post_no_description(self, mock_create): def test_post_no_description(self, mock_create):
# Setup # Setup