Skip to content

Commit

Permalink
Less
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau committed Oct 17, 2023
1 parent 709c10d commit 5517c56
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/integration/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,9 @@ def test_auth_environ():


def test_auth_environ_raises(monkeypatch):
# Temporarily remove any existing authentication and make it so
# future attempts at authentication don't work
monkeypatch.setattr(earthaccess.__auth__, "authenticated", False)

def bad_login(*args, **kwargs):
raise RuntimeError("Can't login")

monkeypatch.setattr(earthaccess.Auth, "login", bad_login)
# Temporarily ensure `earthaccess.__auth__` always returns a
# new, unauthenticated `earthaccess.Auth`` instance
monkeypatch.setattr(earthaccess, "__auth__", earthaccess.Auth())

# Ensure `earthaccess.auth_environ()` raises an informative error
# when not authenticated
Expand Down

0 comments on commit 5517c56

Please sign in to comment.