Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #49

Closed
wants to merge 5 commits into from
Closed

test #49

Show file tree
Hide file tree
Changes from all 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: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
httpx>=0.27.2
httpx==0.27.2
omegaconf>=2.3.0
pandas>=1.3.0
password-strength
scikit-learn>=1.5.2
cityhash
cityhash
3 changes: 3 additions & 0 deletions tabpfn_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def __init__(self):
self.httpx_timeout_s = (
4 * 5 * 60 + 15 # temporary workaround for slow computation on server side
)
logger.debug(f"Setting up client with base URL: {self.base_url}")
self.httpx_client = httpx.Client(
base_url=self.base_url,
timeout=self.httpx_timeout_s,
Expand Down Expand Up @@ -525,6 +526,7 @@ def login(self, email: str, password: str) -> tuple[str, str]:
"""

access_token = None
logger.debug(f"Logging at url: {self.server_endpoints.login.path}")
response = self.httpx_client.post(
self.server_endpoints.login.path,
data=common_utils.to_oauth_request_form(email, password),
Expand Down Expand Up @@ -704,3 +706,4 @@ def delete_user_account(self, confirm_pass: str) -> None:
)

self._validate_response(response, "delete_user_account")
# new commit
8 changes: 8 additions & 0 deletions tabpfn_client/tests/unit/test_tabpfn_classifier.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
from unittest.mock import patch, MagicMock
import shutil
import logging

import numpy as np
from sklearn.datasets import load_breast_cancer
Expand All @@ -17,6 +18,10 @@
from tabpfn_client import config


logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)


class TestTabPFNClassifierInit(unittest.TestCase):
dummy_token = "dummy_token"

Expand Down Expand Up @@ -84,6 +89,9 @@ def test_init_remote_classifier(

@with_mock_server()
def test_reuse_saved_access_token(self, mock_server):
# Add debug logs
logger.debug(f"Mock server base URL: {mock_server.base_url}")
logger.debug(f"Mock server root path: {mock_server.endpoints.root.path}")
# mock connection and authentication
mock_server.router.get(mock_server.endpoints.root.path).respond(200)
mock_server.router.get(mock_server.endpoints.protected_root.path).respond(200)
Expand Down
Loading