Skip to content

Commit

Permalink
Merge pull request #55 from mitya57/test-empty-username
Browse files Browse the repository at this point in the history
Override test_empty_username from keyring 25.3.0 for file backend
  • Loading branch information
jaraco authored Aug 14, 2024
2 parents c821934 + f88745f commit 55cd220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def Put(
delattr(self, '_put_err')
else:
put_err = self._put_err
if type(put_err) == tuple:
if type(put_err) is tuple:
raise put_err[0](put_err[1])
else:
raise put_err()
Expand All @@ -161,7 +161,7 @@ def Export(self, entry_or_id_or_url, file_path, gid=None, extra_params=None):

def request(self, data, uri):
if hasattr(self, '_request_err'):
if type(self._request_err) == tuple:
if type(self._request_err) is tuple:
raise self._request_err[0](self._request_err[1])
else:
raise self._request_err()
Expand Down
4 changes: 4 additions & 0 deletions tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def test_version(self):
self.save_config(config)
assert self.keyring._check_version(config) is False

def test_empty_username(self):
with pytest.raises(ValueError):
self.set_password('service1', '', 'password1')


@pytest.fixture(scope="class")
def monkeyclass(request):
Expand Down

0 comments on commit 55cd220

Please sign in to comment.