def main(argv=None): """Forget credentials for Ubuntu One SSO.""" argv = argv if argv else [] docopt(__doc__, argv=argv) logger.info('Clearing credentials for Ubuntu One SSO.') clear_config() logger.info('Credentials cleared.')
def test_clear_config_with_no_existing_file(self): config = load_config() assert config == {} clear_config() config = load_config() self.assertEqual(config, {})
def test_clear_config_removes_existing_section(self): cfg = ConfigParser() cfg.add_section('login.ubuntu.com') cfg.set('login.ubuntu.com', 'foo', '1') with open(self.filename, 'w') as fd: cfg.write(fd) config = load_config() assert config != {} clear_config() config = load_config() self.assertEqual(config, {})
def test_clear_config_with_no_existing_section(self): cfg = ConfigParser() cfg.add_section('some.domain') cfg.set('some.domain', 'foo', '1') with open(self.filename, 'w') as fd: cfg.write(fd) config = load_config() assert config == {} clear_config() config = load_config() self.assertEqual(config, {})
def logout(): logger.info("Clearing credentials for Ubuntu One SSO.") clear_config() logger.info("Credentials cleared.")
def logout(): logger.info('Clearing credentials for Ubuntu One SSO.') clear_config() logger.info('Credentials cleared.')