Example #1
0
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.')
Example #2
0
    def test_clear_config_with_no_existing_file(self):
        config = load_config()
        assert config == {}

        clear_config()

        config = load_config()
        self.assertEqual(config, {})
Example #3
0
    def test_clear_config_with_no_existing_file(self):
        config = load_config()
        assert config == {}

        clear_config()

        config = load_config()
        self.assertEqual(config, {})
Example #4
0
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.')
Example #5
0
    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, {})
Example #6
0
    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, {})
Example #7
0
    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, {})
Example #8
0
    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, {})
Example #9
0
def logout():
    logger.info("Clearing credentials for Ubuntu One SSO.")
    clear_config()
    logger.info("Credentials cleared.")
Example #10
0
def logout():
    logger.info('Clearing credentials for Ubuntu One SSO.')
    clear_config()
    logger.info('Credentials cleared.')