Last active
September 19, 2015 21:17
-
-
Save muonzoo/0fe4838faa2691e6f061 to your computer and use it in GitHub Desktop.
Quick keyring test code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import keyring | |
url=r'http://urlwatch.example.com/' | |
user='alice' | |
password =r'12345not_a_good_password' | |
class TestKeyring(unittest.TestCase): | |
@classmethod | |
def setUpClass(cls): | |
try: | |
keyring.delete_password(url,user) | |
except: | |
pass | |
def test_keyring_set(self): | |
self.assertEqual(keyring.set_password(url,user,password),None) | |
self.assertEqual(keyring.get_password(url,user),password) | |
@classmethod | |
def tearDownClass(cls): | |
keyring.delete_password(url,user) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment