Skip to content

Commit

Permalink
Use simple asserts as assertEqual only works under unittest. Ref #550.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 28, 2021
1 parent 0426944 commit c63ab7d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tests/backends/test_kwallet.py
Expand Up @@ -40,16 +40,14 @@ def check_set_get(self, service, username, password):
keyring = self.keyring

# for the non-existent password
self.assertEqual(keyring.get_password(service, username), None)
assert keyring.get_password(service, username) is None

# common usage
self.set_password(service, username, password, True)
# re-init keyring to force migration
self.keyring = keyring = self.init_keyring()
ret_password = keyring.get_password(service, username)
self.assertEqual(
ret_password,
password,
assert ret_password == password, (
"Incorrect password for username: '%s' "
"on service: '%s'. '%s' != '%s'"
% (service, username, ret_password, password),
Expand All @@ -60,16 +58,12 @@ def check_set_get(self, service, username, password):
# re-init keyring to force migration
self.keyring = keyring = self.init_keyring()
ret_password = keyring.get_password(service, username)
self.assertEqual(
ret_password,
"",
assert ret_password == "", (
"Incorrect password for username: '%s' "
"on service: '%s'. '%s' != '%s'" % (service, username, ret_password, ""),
)
ret_password = keyring.get_password('Python', username + '@' + service)
self.assertEqual(
ret_password,
None,
assert ret_password is None, (
"Not 'None' password returned for username: '%s' "
"on service: '%s'. '%s' != '%s'. Passwords from old "
"folder should be deleted during migration."
Expand Down

0 comments on commit c63ab7d

Please sign in to comment.