Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions mergin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ def __init__(
if not self._auth_session:
self.login(login, password)

else:
if not self._auth_session:
raise ClientError("Unable to log in: no auth token provided for login")

def setup_logging(self):
"""Setup Mergin Maps client logging."""
client_log_file = os.environ.get("MERGIN_CLIENT_LOG", None)
Expand Down
15 changes: 15 additions & 0 deletions mergin/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2871,3 +2871,18 @@ def server_config(self):

with pytest.raises(ClientError, match="The requested URL was not found on the server"):
mc.send_logs(logs_path)


def test_mc_without_login():

# client without login should be able to access server config
mc = MerginClient(SERVER_URL)
config = mc.server_config()
assert config
assert isinstance(config, dict)
assert "server_configured" in config
assert config["server_configured"]

# without login should not be able to access workspaces
with pytest.raises(ClientError, match="The requested URL was not found on the server"):
mc.workspaces_list()
Loading