コード例 #1
0
    def test_logout(self):
        """Test logout command"""

        sys.argv = ['venmo_launcher.py', 'logout']
        wf.save_password('venmo_access_token', 'access')
        wf.save_password('venmo_refresh_token', 'refresh')

        self.assertEqual(wf.get_password('venmo_access_token'), 'access')
        self.assertEqual(wf.get_password('venmo_refresh_token'), 'refresh')

        main(None)

        self.assertFalse(wf.get_password('venmo_access_token'))
        self.assertFalse(wf.get_password('venmo_token_token'))
コード例 #2
0
    def test_clear_cache(self):
        """Test clear_cache command"""

        sys.argv = ['venmo_launcher.py', 'clear']
        wf.cache_data('venmo_api_results', 'data')
        wf.cache_data('venmo_api_results_backup', 'backup_data')

        self.assertEqual(wf.cached_data('venmo_api_results'), 'data')
        self.assertEqual(wf.cached_data('venmo_api_results_backup'), 'backup_data')

        main(None)

        with self.assertRaises(KeyError):
            wf.cached_data('venmo_api_results')
            wf.cached_data('venmo_api_results_backup')