From d00da48ccc2ba7c1cc9ab007c18d436cddd70315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Thu, 3 Dec 2015 09:12:39 +0100 Subject: [PATCH] selftests: Add unittest to load simple tests with arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds unittest for loading simple tests with arguments. Signed-off-by: Lukáš Doktor --- selftests/unit/test_loader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/selftests/unit/test_loader.py b/selftests/unit/test_loader.py index 476de3c0..4acbbeef 100644 --- a/selftests/unit/test_loader.py +++ b/selftests/unit/test_loader.py @@ -133,6 +133,11 @@ class LoaderTest(unittest.TestCase): self.assertTrue(test_class == test.SimpleTest, test_class) tc = test_class(**test_parameters) tc.test() + # Load with params + simple_with_params = simple_test.path + " 'foo bar' --baz" + suite = self.loader.discover(simple_with_params, True) + self.assertEqual(len(suite), 1) + self.assertEqual(suite[0][1]["name"], simple_with_params) simple_test.remove() def test_load_simple_not_exec(self): -- GitLab