[Py34] Enable test_legacy_v2_compatible_wrapper

Rquired change in tests:
    generator.next() -> next(generator)

Change-Id: Ie5c087d8020f6998f24b34fb8dca3599024d443f
This commit is contained in:
Andrey Kurilin 2015-09-22 16:40:32 +03:00
parent 251e09ab69
commit 086ea396f2
2 changed files with 7 additions and 8 deletions

View File

@ -146,7 +146,7 @@ class TestSoftAddtionalPropertiesValidation(test.NoDBTestCase):
instance = {'foo': '1'}
gen = validators._soft_validate_additional_properties(
validator, False, instance, self.schema)
self.assertRaises(StopIteration, gen.next)
self.assertRaises(StopIteration, next, gen)
self.assertEqual({'foo': '1'}, instance)
def test_strip_extra_properties_out_with_extra_props(self):
@ -154,7 +154,7 @@ class TestSoftAddtionalPropertiesValidation(test.NoDBTestCase):
instance = {'foo': '1', 'extra_foo': 'extra'}
gen = validators._soft_validate_additional_properties(
validator, False, instance, self.schema)
self.assertRaises(StopIteration, gen.next)
self.assertRaises(StopIteration, next, gen)
self.assertEqual({'foo': '1'}, instance)
def test_not_strip_extra_properties_out_with_allow_extra_props(self):
@ -162,7 +162,7 @@ class TestSoftAddtionalPropertiesValidation(test.NoDBTestCase):
instance = {'foo': '1', 'extra_foo': 'extra'}
gen = validators._soft_validate_additional_properties(
validator, True, instance, self.schema_allow)
self.assertRaises(StopIteration, gen.next)
self.assertRaises(StopIteration, next, gen)
self.assertEqual({'foo': '1', 'extra_foo': 'extra'}, instance)
def test_pattern_properties_with_invalid_property_and_allow_extra_props(
@ -172,7 +172,7 @@ class TestSoftAddtionalPropertiesValidation(test.NoDBTestCase):
instance = {'foo': '1', 'b' * 300: 'extra'}
gen = validators._soft_validate_additional_properties(
validator, True, instance, self.schema_with_pattern)
self.assertRaises(StopIteration, gen.next)
self.assertRaises(StopIteration, next, gen)
def test_pattern_properties(self):
validator = validators._SchemaValidator(
@ -180,7 +180,7 @@ class TestSoftAddtionalPropertiesValidation(test.NoDBTestCase):
instance = {'foo': '1'}
gen = validators._soft_validate_additional_properties(
validator, False, instance, self.schema_with_pattern)
self.assertRaises(StopIteration, gen.next)
self.assertRaises(StopIteration, next, gen)
def test_pattern_properties_with_invalid_property(self):
validator = validators._SchemaValidator(
@ -188,7 +188,7 @@ class TestSoftAddtionalPropertiesValidation(test.NoDBTestCase):
instance = {'foo': '1', 'b' * 300: 'extra'}
gen = validators._soft_validate_additional_properties(
validator, False, instance, self.schema_with_pattern)
exc = gen.next()
exc = next(gen)
self.assertIsInstance(exc,
jsonschema_exc.ValidationError)
self.assertIn('was', exc.message)
@ -199,7 +199,7 @@ class TestSoftAddtionalPropertiesValidation(test.NoDBTestCase):
instance = {'foo': '1', 'b' * 300: 'extra', 'c' * 300: 'extra'}
gen = validators._soft_validate_additional_properties(
validator, False, instance, self.schema_with_pattern)
exc = gen.next()
exc = next(gen)
self.assertIsInstance(exc,
jsonschema_exc.ValidationError)
self.assertIn('were', exc.message)

View File

@ -143,7 +143,6 @@ nova.tests.unit.api.openstack.compute.test_volumes.VolumeAttachTestsV21
nova.tests.unit.api.openstack.test_common.LimiterTest
nova.tests.unit.api.openstack.test_faults.TestFaultWrapper
nova.tests.unit.api.openstack.test_faults.TestFaults
nova.tests.unit.api.openstack.test_legacy_v2_compatible_wrapper.TestSoftAddtionalPropertiesValidation
nova.tests.unit.api.openstack.test_mapper.MapperTest
nova.tests.unit.api.openstack.test_wsgi.JSONDeserializerTest
nova.tests.unit.api.openstack.test_wsgi.RequestTest