There were three different mechanisms for skipping tests in the suite.
For the most part, skipIf was used, so sync to that. Additionally, it
was being used as a decorater in most places, but as a call in a few,
so make it a decorator everywhere. Finally, if it's on the setUp method,
it's not necessary for it to be on any of the individual tests in the class.
Change-Id: I7fbd09a6bc015e698a190b989d0f8641c4adb63e
class QuantumFloatingIPTest(HeatTestCase):
+ @skipIf(net.clients.quantumclient is None, "Missing Quantum Client")
def setUp(self):
super(QuantumFloatingIPTest, self).setUp()
self.m.StubOutWithMock(floatingip.FloatingIP, 'quantum')
self.assertEqual(s3.S3Bucket.CREATE_COMPLETE, resource.state)
return resource
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_create_container_name(self):
self.m.ReplayAll()
t = template_format.parse(swift_template)
self.assertTrue(re.match(self.container_pattern,
resource._create_container_name()))
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_attributes(self):
swiftclient.Connection.put_container(
mox.Regex(self.container_pattern),
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_public_read(self):
swiftclient.Connection.put_container(
mox.Regex(self.container_pattern),
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_public_read_write(self):
swiftclient.Connection.put_container(
mox.Regex(self.container_pattern),
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_authenticated_read(self):
swiftclient.Connection.put_container(
mox.Regex(self.container_pattern),
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_website(self):
swiftclient.Connection.put_container(
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_delete_exception(self):
swiftclient.Connection.put_container(
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_delete_retain(self):
# first run, with retain policy
self.assertEqual(swift.SwiftContainer.CREATE_COMPLETE, resource.state)
return resource
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_create_container_name(self):
self.m.ReplayAll()
t = template_format.parse(swift_template)
'the_name',
resource._create_container_name('the_name'))
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_build_meta_headers(self):
self.m.UnsetStubs()
self.assertEqual({}, swift.SwiftContainer._build_meta_headers({}))
"Web-Error": "error.html"
}))
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_attributes(self):
headers = {
"content-length": "0",
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_public_read(self):
swiftclient.Connection.put_container(
mox.Regex(self.container_pattern),
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_public_read_write(self):
swiftclient.Connection.put_container(
mox.Regex(self.container_pattern),
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_website(self):
swiftclient.Connection.put_container(
resource.delete()
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_delete_exception(self):
swiftclient.Connection.put_container(
self.m.VerifyAll()
- @skipIf(swiftclient is None, 'unable to import swiftclient')
def test_delete_retain(self):
# first run, with retain policy
for key in stack1.resources:
self.assertEqual(stack1.resources[key].t, stack2.resources[key].t)
+ @skipIf(clients.quantumclient is None, 'quantumclient unavailable')
def test_quantum_resolved(self):
- skipIf(clients.quantumclient is None, 'quantumclient unavailable')
self.compare_stacks('Quantum.template', 'Quantum.yaml', {})
def test_wordpress_resolved(self):
class VPCTestBase(HeatTestCase):
+ @skipIf(quantumclient is None, 'quantumclient unavaialble')
def setUp(self):
super(VPCTestBase, self).setUp()
- skipIf(quantumclient is None, 'quantumclient unavaialble')
setup_dummy_db()
self.m.StubOutWithMock(quantumclient.Client, 'add_interface_router')
self.m.StubOutWithMock(quantumclient.Client, 'add_gateway_router')