From 8a69363f8e00b047f89c74f5a0a89d218f868a42 Mon Sep 17 00:00:00 2001 From: Yves-Gwenael Bourhis Date: Thu, 14 Mar 2019 10:39:37 +0100 Subject: [PATCH] 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 --- ospurge/tests/test_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ospurge/tests/test_utils.py b/ospurge/tests/test_utils.py index f3e2e95..5ba066e 100644 --- a/ospurge/tests/test_utils.py +++ b/ospurge/tests/test_utils.py @@ -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():