Skip to content

Commit

Permalink
Merge pull request #219 from grycap/devel
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
micafer authored Sep 17, 2021
2 parents 5fbcd28 + 5204a8f commit 126623b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_manageinf_stop(self, flash, avatar, put, user_data):
self.assertEqual(302, res.status_code)
self.assertIn('http://localhost/infrastructures', res.headers['location'])
self.assertEquals(flash.call_args_list[0][0],
("Operation 'stop' successfully made on Infrastructure ID: infid", 'info'))
("Operation 'stop' successfully made on Infrastructure ID: infid", 'success'))

@patch("app.utils.getUserAuthData")
@patch('requests.get')
Expand All @@ -229,7 +229,7 @@ def test_managevm_stop(self, flash, avatar, put, user_data):
res = self.client.post('/managevm/stop/infid/0')
self.assertEqual(302, res.status_code)
self.assertIn('http://localhost/vminfo?infId=infid&vmId=0', res.headers['location'])
self.assertEquals(flash.call_args_list[0][0], ("Operation 'stop' successfully made on VM ID: 0", 'info'))
self.assertEquals(flash.call_args_list[0][0], ("Operation 'stop' successfully made on VM ID: 0", 'success'))

@patch("app.utils.getUserAuthData")
@patch('requests.delete')
Expand All @@ -242,7 +242,7 @@ def test_managevm_delet(self, flash, avatar, delete, user_data):
res = self.client.post('/managevm/terminate/infid/0')
self.assertEqual(302, res.status_code)
self.assertIn('http://localhost/infrastructures', res.headers['location'])
self.assertEquals(flash.call_args_list[0][0], ("Operation 'terminate' successfully made on VM ID: 0", 'info'))
self.assertEquals(flash.call_args_list[0][0], ("Operation 'terminate' successfully made on VM ID: 0", 'success'))

@patch("app.utils.getUserAuthData")
@patch('requests.put')
Expand All @@ -255,7 +255,7 @@ def test_reconfigure(self, flash, avatar, put, user_data):
res = self.client.post('/manage_inf/infid/reconfigure')
self.assertEqual(302, res.status_code)
self.assertIn('http://localhost/infrastructures', res.headers['location'])
self.assertEquals(flash.call_args_list[0][0], ("Reconfiguration process successfuly started.", 'info'))
self.assertEquals(flash.call_args_list[0][0], ("Reconfiguration process successfuly started.", 'success'))

@patch("app.utils.getUserAuthData")
@patch('requests.get')
Expand Down Expand Up @@ -316,7 +316,7 @@ def test_delete(self, flash, avatar, delete, user_data):
res = self.client.post('/manage_inf/infid/delete')
self.assertEqual(302, res.status_code)
self.assertIn('http://localhost/infrastructures', res.headers['location'])
self.assertEquals(flash.call_args_list[0][0], ("Infrastructure 'infid' successfuly deleted.", 'info'))
self.assertEquals(flash.call_args_list[0][0], ("Infrastructure 'infid' successfuly deleted.", 'success'))

@patch("app.utils.avatar")
@patch("app.cred.Credentials.get_creds")
Expand Down Expand Up @@ -416,15 +416,15 @@ def test_write_creds(self, flash, write_creds, get_cred, avatar):
"id": "credid"})
self.assertEqual(302, res.status_code)
self.assertIn('/manage_creds', res.headers['location'])
self.assertEquals(flash.call_args_list[0][0], ("Credentials successfully written!", 'info'))
self.assertEquals(flash.call_args_list[0][0], ("Credentials successfully written!", 'success'))
self.assertEquals(write_creds.call_args_list[0][0], ('credid', 'userid', {'host': 'SITE_URL2',
'id': 'credid'}, False))

res = self.client.post('/write_creds?cred_id=&cred_type=OpenNebula', data={"host": "SITE_URL3",
"id": "credid"})
self.assertEqual(302, res.status_code)
self.assertIn('/manage_creds', res.headers['location'])
self.assertEquals(flash.call_args_list[1][0], ("Credentials successfully written!", 'info'))
self.assertEquals(flash.call_args_list[1][0], ("Credentials successfully written!", 'success'))
self.assertEquals(write_creds.call_args_list[1][0], ('credid', 'userid', {'host': 'SITE_URL3',
'id': 'credid'}, True))

Expand All @@ -437,7 +437,7 @@ def test_delete_creds(self, flash, delete_cred, avatar):
res = self.client.get('/delete_creds?service_id=SERVICE_ID')
self.assertEqual(302, res.status_code)
self.assertIn('/manage_creds', res.headers['location'])
self.assertEquals(flash.call_args_list[0][0], ("Credentials successfully deleted!", 'info'))
self.assertEquals(flash.call_args_list[0][0], ("Credentials successfully deleted!", 'success'))

@patch("app.utils.getUserAuthData")
@patch('requests.get')
Expand All @@ -464,7 +464,7 @@ def test_addresources(self, flash, avatar, post, get, user_data):
self.login(avatar)
res = self.client.post('/addresources/infid', data={"wn_num": "1"})
self.assertEqual(302, res.status_code)
self.assertEquals(flash.call_args_list[0][0], ("1 nodes added successfully", 'info'))
self.assertEquals(flash.call_args_list[0][0], ("1 nodes added successfully", 'success'))

@patch("app.utils.avatar")
@patch("app.utils.getUserAuthData")
Expand Down

0 comments on commit 126623b

Please sign in to comment.