From 77c560b40cfcfb774dc51f906bb1a8474655d4e2 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 3 Jun 2022 23:46:03 +0200 Subject: [PATCH] Improved cpl remove test --- unittests/unittests_cli/remove_test_case.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/unittests/unittests_cli/remove_test_case.py b/unittests/unittests_cli/remove_test_case.py index a397c44f..b61a5d3f 100644 --- a/unittests/unittests_cli/remove_test_case.py +++ b/unittests/unittests_cli/remove_test_case.py @@ -17,6 +17,14 @@ class RemoveTestCase(unittest.TestCase): self._target = 'add-test-library' self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' + def _get_project_settings(self): + with open(os.path.join(os.getcwd(), self._project_file), 'r', encoding='utf-8') as cfg: + # load json + project_json = json.load(cfg) + cfg.close() + + return project_json + def setUp(self): os.chdir(os.path.abspath(PLAYGROUND_PATH)) # create projects @@ -30,3 +38,11 @@ class RemoveTestCase(unittest.TestCase): self.assertTrue(os.path.exists(os.getcwd())) self.assertTrue(os.path.exists(os.path.join(os.getcwd(), self._project_file))) self.assertFalse(os.path.exists(path)) + settings = self._get_project_settings() + self.assertIn('ProjectSettings', settings) + self.assertIn('ProjectReferences', settings['BuildSettings']) + self.assertIn('BuildSettings', settings) + self.assertNotIn( + f'../{String.convert_to_snake_case(self._target)}/{self._target}.json', + settings['BuildSettings']['ProjectReferences'] + )