Fix test_get_resource_classes parameter passing

In utils.get_resource_classes we expect a list of strings.
However we are passing a string.
The test was succeding by pure luck.
If we pass something else (such as 'Stacks') we had multiple results.
This test was confusing for other developers implementing other tests.

Closes-Bug: #1820033

Change-Id: I8414b7582d94b199457a01e4916a7e7b6e51edbc
This commit is contained in:
Yves-Gwenael Bourhis 2019-03-14 10:39:37 +01:00
parent 02bcffc174
commit 8a69363f8e
1 changed files with 4 additions and 2 deletions

View File

@ -90,11 +90,13 @@ class TestUtils(unittest.TestCase):
self.assertTrue(issubclass(klass, ServiceResource))
def test_get_resource_classes(self):
config = "Networks"
classes = utils.get_resource_classes(config)
resources = ['Stacks', 'Networks']
classes = utils.get_resource_classes(resources)
self.assertTrue(len(classes) == 2)
self.assertIsInstance(classes, typing.List)
for klass in classes:
self.assertTrue(issubclass(klass, ServiceResource))
self.assertIn(klass.__name__, resources)
def test_call_and_ignore_notfound(self):
def raiser():