def test_confirm_subscription_changes_with_no(self): self.type_when_asked('no') # python2.6 does not raise SystemExit exit = self.mocker.replace('sys.exit') self.expect(exit(1)).throw(SystemExit()) self.mocker.replay() cmd = UpdateCommand(StubConfig()) with self.assertRaises(SystemExit): cmd.confirm_subscription_changes()
def test_confirm_subscription_changes_with_yes(self): self.type_when_asked('yes') self.mocker.replay() cmd = UpdateCommand(StubConfig()) self.assertTrue(cmd.confirm_subscription_changes())