"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/test_api_periodictask.py" between
privacyidea-3.5.2.tar.gz and privacyidea-3.6.tar.gz

About: privacyIDEA is a flexible two factor authentication server that can be used to enhance the security of existing applications like local login, VPN, remote access, SSH connections or access to web sites.

test_api_periodictask.py  (privacyidea-3.5.2):test_api_periodictask.py  (privacyidea-3.6)
skipping to change at line 60 skipping to change at line 60
# create task # create task
with self.mock_task_module(): with self.mock_task_module():
task_dict1 = { task_dict1 = {
'name': 'some task', 'name': 'some task',
'nodes': 'pinode1, pinode2', 'nodes': 'pinode1, pinode2',
'active': False, 'active': False,
'interval': '0 8 * * *', 'interval': '0 8 * * *',
'taskmodule': 'UnitTest', 'taskmodule': 'UnitTest',
'ordering': 5, 'ordering': 5,
'retry_if_failed': False,
'options': '{"something": 123, "else": true}', 'options': '{"something": 123, "else": true}',
} }
status_code, data = self.simulate_request('/periodictask/', method=' POST', data=task_dict1) status_code, data = self.simulate_request('/periodictask/', method=' POST', data=task_dict1)
self.assertEqual(status_code, 200) self.assertEqual(status_code, 200)
self.assertEqual(data['result']['status'], True) self.assertEqual(data['result']['status'], True)
ptask_id1 = data['result']['value'] ptask_id1 = data['result']['value']
# some invalid tasks # some invalid tasks
invalid_task_dicts = [ invalid_task_dicts = [
# invalid ordering # invalid ordering
skipping to change at line 168 skipping to change at line 169
# find first task # find first task
result_dict = data['result']['value'][1] result_dict = data['result']['value'][1]
self.assertEqual(result_dict['id'], ptask_id1) self.assertEqual(result_dict['id'], ptask_id1)
self.assertEqual(result_dict['ordering'], 5) self.assertEqual(result_dict['ordering'], 5)
self.assertEqual(result_dict['name'], 'some task') self.assertEqual(result_dict['name'], 'some task')
self.assertEqual(result_dict['active'], False) self.assertEqual(result_dict['active'], False)
self.assertEqual(result_dict['interval'], '0 8 * * *') self.assertEqual(result_dict['interval'], '0 8 * * *')
self.assertEqual(result_dict['nodes'], ['pinode1', 'pinode2']) self.assertEqual(result_dict['nodes'], ['pinode1', 'pinode2'])
self.assertEqual(result_dict['last_runs'], {}) self.assertEqual(result_dict['last_runs'], {})
last_update = parse_timestamp(result_dict['last_update']) last_update = parse_timestamp(result_dict['last_update'])
self.assertEqual(result_dict['retry_if_failed'], False)
self.assertIsNotNone(last_update) self.assertIsNotNone(last_update)
self.assertEqual(result_dict['options'], {'something': '123', 'else': 'T rue'}) self.assertEqual(result_dict['options'], {'something': '123', 'else': 'T rue'})
# get one # get one
status_code, data = self.simulate_request('/periodictask/{}'.format(ptas k_id1), method='GET') status_code, data = self.simulate_request('/periodictask/{}'.format(ptas k_id1), method='GET')
self.assertEqual(status_code, 200) self.assertEqual(status_code, 200)
self.assertEqual(data['result']['value']['id'], ptask_id1) self.assertEqual(data['result']['value']['id'], ptask_id1)
# unknown ID # unknown ID
status_code, data = self.simulate_request('/periodictask/4242', method=' GET') status_code, data = self.simulate_request('/periodictask/4242', method=' GET')
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)