Пример #1
0
    def test_logout_all(self, mock_delete_cred_file):
        #setup
        storage_mock = {'subscriptions': None}
        profile = Profile(storage_mock)
        consolidated = Profile._normalize_properties(self.user1,
                                                     [self.subscription1],
                                                     False, ENV_DEFAULT)
        consolidated2 = Profile._normalize_properties(self.user2,
                                                      [self.subscription2],
                                                      False, ENV_DEFAULT)
        profile._set_subscriptions(consolidated + consolidated2)

        self.assertEqual(2, len(storage_mock['subscriptions']))
        #action
        profile.logout_all()

        #verify
        self.assertEqual(0, len(storage_mock['subscriptions']))
        self.assertEqual(mock_delete_cred_file.call_count, 1)
Пример #2
0
    def test_logout_all(self, mock_delete_cred_file):
        #setup
        storage_mock = {'subscriptions': None}
        profile = Profile(storage_mock)
        consolidated = Profile._normalize_properties(self.user1,
                                                     [self.subscription1],
                                                     False,
                                                     ENV_DEFAULT)
        consolidated2 = Profile._normalize_properties(self.user2,
                                                      [self.subscription2],
                                                      False,
                                                      ENV_DEFAULT)
        profile._set_subscriptions(consolidated + consolidated2)

        self.assertEqual(2, len(storage_mock['subscriptions']))
        #action
        profile.logout_all()

        #verify
        self.assertEqual(0, len(storage_mock['subscriptions']))
        self.assertEqual(mock_delete_cred_file.call_count, 1)
Пример #3
0
def account_clear():
    '''Clear all stored subscriptions. To clear individual, use \'logout\''''
    profile = Profile()
    profile.logout_all()
Пример #4
0
def account_clear():
    '''Clear all stored subscriptions. To clear individual, use \'logout\''''
    profile = Profile()
    profile.logout_all()