P8: Fix pep8 error in cyborg/tests and add post_mortem_debug.py

1. Add post_mortem_debug.py because accelerator/drivers/gpu/test_base.py
lack this file[1]. Reference Neutron[2,3].

[1]. https://github.com/openstack/cyborg/blob/master/cyborg/tests/base.py#L104
[2]. 43352e67e5/neutron/tests/base.py (L229)
[3]. https://github.com/openstack/neutron/blob/master/neutron/tests/post_mortem_debug.py

2. Remove old useless file cyborg/tests/unit/fake_accelerator.py[4,5].

[4]. https://github.com/openstack/cyborg/search?q=fake_accelerator_obj&unscoped_q=fake_accelerator_obj
[5]. https://review.opendev.org/#/c/625630/

Change-Id: I147bfe9a8dfb6bdbe7e59fa3dc0c146c70e4d3a7
This commit is contained in:
chenke
2019-08-31 19:48:19 +08:00
parent ac4c4ea15c
commit 306b82e214
28 changed files with 179 additions and 148 deletions

View File

@@ -18,8 +18,6 @@ from six.moves import http_client
from oslo_serialization import jsonutils
from cyborg.api.controllers.v2.device_profiles import DeviceProfilesController
from cyborg.common import exception
from cyborg.tests.unit.api.controllers.v2 import base as v2_test
from cyborg.tests.unit import fake_device_profile
@@ -68,7 +66,8 @@ class TestDeviceProfileController(v2_test.APITestV2):
data = self.get_json(self.DP_URL, headers=self.headers)
out_dps = data['device_profiles']
self.assertTrue(isinstance(out_dps, list))
result = isinstance(out_dps, list)
self.assertTrue(result)
self.assertTrue(len(out_dps), len(self.fake_dp_objs))
for in_dp, out_dp in zip(self.fake_dp_objs, out_dps):
self._validate_dp(in_dp, out_dp)