def test_add(self): """Test if the `add` subcommand can add projects to the config file.""" try: cmd = ['semantic', 'add', 'dummy_added_project', '/tmp/dummy.yaml'] subprocess.check_call(cmd, env=self.testenv) projects = pr.get_projects() self.assertIn(("dummy_added_project", "/tmp/dummy.yaml"), projects) finally: pr.remove_project("dummy_added_project")
def test_remove(self): """Test if the remove subcommand can remove projects.""" pr.add_project("dummy_project_2", "/foo/baz.yaml") try: cmd = ['semantic', 'remove', 'dummy_project_2'] subprocess.check_call(cmd, env=self.testenv) projects = pr.get_projects() proj_names = [p[0] for p in projects] self.assertNotIn("dummy_project_2", proj_names) finally: pr.remove_project("dummy_project_2")