Browse Source

Replace unittest2 with testtools

Remove unittest2 from test-requirements.txt
Replace unittest2 with testtools in files:
* openstack_dashboard/test/api_tests/keystone_rest_tests.py
* openstack_dashboard/test/api_tests/rest_util_tests.py
* openstack_dashboard/test/api_tests/nova_rest_tests.py

Change-Id: Ic56b1096386548e8253e40cbd54ee5fc579cf413
Closes-Bug: #1179009
changes/69/152869/4
Wu Wenxiang 6 years ago
parent
commit
8e8c084847
4 changed files with 6 additions and 7 deletions
  1. +2
    -2
      openstack_dashboard/test/api_tests/keystone_rest_tests.py
  2. +2
    -2
      openstack_dashboard/test/api_tests/nova_rest_tests.py
  3. +2
    -2
      openstack_dashboard/test/api_tests/rest_util_tests.py
  4. +0
    -1
      test-requirements.txt

+ 2
- 2
openstack_dashboard/test/api_tests/keystone_rest_tests.py View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
import unittest2
import testtools
from django.conf import settings
@ -21,7 +21,7 @@ from openstack_dashboard.api.rest import keystone
from rest_test_utils import construct_request # noqa
class KeystoneRestTestCase(unittest2.TestCase):
class KeystoneRestTestCase(testtools.TestCase):
def assertStatusCode(self, response, expected_code):
if response.status_code == expected_code:
return


+ 2
- 2
openstack_dashboard/test/api_tests/nova_rest_tests.py View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
import unittest2
import testtools
from django.conf import settings
@ -21,7 +21,7 @@ from openstack_dashboard.api.rest import nova
from rest_test_utils import construct_request # noqa
class NovaRestTestCase(unittest2.TestCase):
class NovaRestTestCase(testtools.TestCase):
def assertStatusCode(self, response, expected_code):
if response.status_code == expected_code:
return


+ 2
- 2
openstack_dashboard/test/api_tests/rest_util_tests.py View File

@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
import unittest2
import testtools
from openstack_dashboard.api.rest import utils
class RestUtilsTestCase(unittest2.TestCase):
class RestUtilsTestCase(testtools.TestCase):
def assertStatusCode(self, response, expected_code):
if response.status_code == expected_code:
return


+ 0
- 1
test-requirements.txt View File

@ -23,6 +23,5 @@ oslosphinx>=2.2.0 # Apache-2.0
selenium
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
testtools>=0.9.36,!=1.2.0
unittest2
# This also needs xvfb library installed on your OS
xvfbwrapper>=0.1.3 #license: MIT

Loading…
Cancel
Save