"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cyborg/tests/unit/objects/test_ext_arq_job.py" between
openstack-cyborg-6.0.0.tar.gz and openstack-cyborg-7.0.0.tar.gz

About: OpenStack Cyborg provides a general purpose management framework for acceleration resources.
The "Xena" series (latest release).

test_ext_arq_job.py  (openstack-cyborg-6.0.0):test_ext_arq_job.py  (openstack-cyborg-7.0.0)
skipping to change at line 349 skipping to change at line 349
def test_bind_notify(self, mock_api, mock_notify): def test_bind_notify(self, mock_api, mock_notify):
mock_api.return_value = type( mock_api.return_value = type(
"NovaAPI", (object,), {"notify_binding": mock_notify}) "NovaAPI", (object,), {"notify_binding": mock_notify})
objects.ext_arq.ExtARQJobMixin.bind_notify( objects.ext_arq.ExtARQJobMixin.bind_notify(
'5922a70f-1e06-4cfd-88dd-a332120d7144', '5922a70f-1e06-4cfd-88dd-a332120d7144',
[('a097fefa-da62-4630-8e8b-424c0e3426dc', 'completed')]) [('a097fefa-da62-4630-8e8b-424c0e3426dc', 'completed')])
mock_api.assert_called_once_with() mock_api.assert_called_once_with()
mock_notify.assert_called_once_with( mock_notify.assert_called_once_with(
'5922a70f-1e06-4cfd-88dd-a332120d7144', '5922a70f-1e06-4cfd-88dd-a332120d7144',
[('a097fefa-da62-4630-8e8b-424c0e3426dc', 'completed')]) [('a097fefa-da62-4630-8e8b-424c0e3426dc', 'completed')])
@mock.patch('cyborg.objects.ExtARQ.unbind')
@mock.patch('cyborg.objects.ext_arq.ExtARQJobMixin.get_suitable_ext_arq')
def test_apply_patch_with_op_remove(self, mock_get, mock_unbind):
patch_list = {}
host_binding = {'path': '/hostname', 'op': 'remove',
'value': 'myhost'}
inst_binding = {'path': '/instance_uuid', 'op': 'remove',
'value': '5922a70f-1e06-4cfd-88dd-a332120d7144'}
device_rp_uuid = 'fb16c293-5739-4c84-8590-926f9ab16669'
arp_uuid = 'a097fefa-da62-4630-8e8b-424c0e3426dc'
patch_list[arp_uuid] = [host_binding, inst_binding, device_rp_uuid]
mock_get.return_value = self.fake_obj_extarqs[0]
valid_fields = {
arp_uuid: {'hostname': 'myhost',
'device_rp_uuid': device_rp_uuid,
'instance_uuid': '5922a70f-1e06-4cfd-88dd-a332120d7144'}
}
objects.extarq.ext_arq_job.ExtARQJobMixin.apply_patch(self.context,
patch_list,
valid_fields)
mock_unbind.assert_called_with(self.context)
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

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