From 7251071435332b8a9254b0a53f76a7479b4863d9 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 21 Apr 2024 17:48:13 +0200 Subject: [PATCH] Fixed debug opt test cases not being run Fixed the naming of the test class so it actually gets collected and run --- test/test_debug_opt.py | 88 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/test/test_debug_opt.py b/test/test_debug_opt.py index ca9115d7f2..0f697323ee 100644 --- a/test/test_debug_opt.py +++ b/test/test_debug_opt.py @@ -23,76 +23,76 @@ from picard.debug_opts import DebugOptEnum -class TestDebugOpt(DebugOptEnum): +class DebugOptTestCase(DebugOptEnum): A = 1, 'titleA', 'descriptionA' B = 2, 'titleB', 'descriptionB' -class DebugOptTest(PicardTestCase): +class TestDebugOpt(PicardTestCase): def setUp(self): - TestDebugOpt.set_registry(set()) + DebugOptTestCase.set_registry(set()) def test_enabled(self): - self.assertFalse(TestDebugOpt.A.enabled) - self.assertFalse(TestDebugOpt.B.enabled) - TestDebugOpt.A.enabled = True - self.assertTrue(TestDebugOpt.A.enabled) + self.assertFalse(DebugOptTestCase.A.enabled) + self.assertFalse(DebugOptTestCase.B.enabled) + DebugOptTestCase.A.enabled = True + self.assertTrue(DebugOptTestCase.A.enabled) def test_optname(self): - self.assertEqual(TestDebugOpt.A.optname, 'a') - self.assertEqual(TestDebugOpt.B.optname, 'b') + self.assertEqual(DebugOptTestCase.A.optname, 'a') + self.assertEqual(DebugOptTestCase.B.optname, 'b') def test_title(self): - self.assertEqual(TestDebugOpt.A.title, 'titleA') - self.assertEqual(TestDebugOpt.B.title, 'titleB') + self.assertEqual(DebugOptTestCase.A.title, 'titleA') + self.assertEqual(DebugOptTestCase.B.title, 'titleB') def test_description(self): - self.assertEqual(TestDebugOpt.A.description, 'descriptionA') - self.assertEqual(TestDebugOpt.B.description, 'descriptionB') + self.assertEqual(DebugOptTestCase.A.description, 'descriptionA') + self.assertEqual(DebugOptTestCase.B.description, 'descriptionB') def test_opt_names(self): - self.assertEqual(TestDebugOpt.opt_names(), 'a,b') + self.assertEqual(DebugOptTestCase.opt_names(), 'a,b') def test_from_string_simple(self): - TestDebugOpt.from_string('a') - self.assertTrue(TestDebugOpt.A.enabled) - self.assertFalse(TestDebugOpt.B.enabled) - TestDebugOpt.from_string('a,b') - self.assertTrue(TestDebugOpt.A.enabled) - self.assertTrue(TestDebugOpt.B.enabled) + DebugOptTestCase.from_string('a') + self.assertTrue(DebugOptTestCase.A.enabled) + self.assertFalse(DebugOptTestCase.B.enabled) + DebugOptTestCase.from_string('a,b') + self.assertTrue(DebugOptTestCase.A.enabled) + self.assertTrue(DebugOptTestCase.B.enabled) def test_from_string_complex(self): - TestDebugOpt.from_string('something, A,x,b') - self.assertTrue(TestDebugOpt.A.enabled) - self.assertTrue(TestDebugOpt.B.enabled) + DebugOptTestCase.from_string('something, A,x,b') + self.assertTrue(DebugOptTestCase.A.enabled) + self.assertTrue(DebugOptTestCase.B.enabled) def test_from_string_remove(self): - TestDebugOpt.set_registry({TestDebugOpt.B}) - self.assertTrue(TestDebugOpt.B.enabled) - TestDebugOpt.from_string('A') - self.assertTrue(TestDebugOpt.A.enabled) - self.assertFalse(TestDebugOpt.B.enabled) + DebugOptTestCase.set_registry({DebugOptTestCase.B}) + self.assertTrue(DebugOptTestCase.B.enabled) + DebugOptTestCase.from_string('A') + self.assertTrue(DebugOptTestCase.A.enabled) + self.assertFalse(DebugOptTestCase.B.enabled) def test_to_string(self): - self.assertEqual('', TestDebugOpt.to_string()) - TestDebugOpt.A.enabled = True - self.assertEqual('a', TestDebugOpt.to_string()) - TestDebugOpt.B.enabled = True - self.assertEqual('a,b', TestDebugOpt.to_string()) + self.assertEqual('', DebugOptTestCase.to_string()) + DebugOptTestCase.A.enabled = True + self.assertEqual('a', DebugOptTestCase.to_string()) + DebugOptTestCase.B.enabled = True + self.assertEqual('a,b', DebugOptTestCase.to_string()) def test_set_get_registry(self): - old_set = TestDebugOpt.get_registry() - TestDebugOpt.A.enabled = True - self.assertTrue(TestDebugOpt.A.enabled) + old_set = DebugOptTestCase.get_registry() + DebugOptTestCase.A.enabled = True + self.assertTrue(DebugOptTestCase.A.enabled) new_set = set() - TestDebugOpt.set_registry(new_set) - self.assertFalse(TestDebugOpt.A.enabled) - TestDebugOpt.B.enabled = True - self.assertFalse(TestDebugOpt.A.enabled) - self.assertTrue(TestDebugOpt.B.enabled) - TestDebugOpt.set_registry(old_set) - self.assertTrue(TestDebugOpt.A.enabled) - self.assertFalse(TestDebugOpt.B.enabled) + DebugOptTestCase.set_registry(new_set) + self.assertFalse(DebugOptTestCase.A.enabled) + DebugOptTestCase.B.enabled = True + self.assertFalse(DebugOptTestCase.A.enabled) + self.assertTrue(DebugOptTestCase.B.enabled) + DebugOptTestCase.set_registry(old_set) + self.assertTrue(DebugOptTestCase.A.enabled) + self.assertFalse(DebugOptTestCase.B.enabled) def test_invalid(self): with self.assertRaises(ValueError):