def test_del_args(self): for alias_type in ("probe", "measurement"): with capture_sys_output() as (stdout, stderr): with self.assertRaises(SystemExit) as e: cmd = Command() cmd.init_args(["del", alias_type]) with self.assertRaises(SystemExit) as e: cmd = Command() cmd.init_args(["del", alias_type, "1"]) try: cmd = Command() cmd.init_args(["del", alias_type, "one"]) except Exception as e: self.fail("Failed with {}".format(str(e)))
def setUp(self): self.cmd = Command() self.aliases = copy.deepcopy(TestAliasCommand.ALIASES) mock.patch(self.ALIASES_CLASS_PATH, FakeAliasesDB).start()