mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-12 09:12:40 +02:00
chore: ran linting
This commit is contained in:
parent
f7bac59a4b
commit
de6fc80dbd
2 changed files with 4 additions and 6 deletions
|
|
@ -41,9 +41,7 @@ _INDEXER_MODULE = "app.tasks.connector_indexers.google_drive_indexer"
|
||||||
_GET_ACCESS_TOKEN = "app.services.composio_service.ComposioService.get_access_token"
|
_GET_ACCESS_TOKEN = "app.services.composio_service.ComposioService.get_access_token"
|
||||||
|
|
||||||
|
|
||||||
def _mock_drive_client(
|
def _mock_drive_client(*, list_files_return: tuple = ([], None, None)) -> MagicMock:
|
||||||
*, list_files_return: tuple = ([], None, None)
|
|
||||||
) -> MagicMock:
|
|
||||||
"""Duck-typed client mock whose ``list_files`` yields the supplied tuple.
|
"""Duck-typed client mock whose ``list_files`` yields the supplied tuple.
|
||||||
|
|
||||||
Returning an empty file list short-circuits the indexer's full-scan
|
Returning an empty file list short-circuits the indexer's full-scan
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ def test_get_access_token_raises_when_state_val_missing():
|
||||||
fake_account.state = None
|
fake_account.state = None
|
||||||
service = _service_with_account(fake_account)
|
service = _service_with_account(fake_account)
|
||||||
|
|
||||||
with pytest.raises(ValueError, match="No state.val.*missing-state-account"):
|
with pytest.raises(ValueError, match=r"No state\.val.*missing-state-account"):
|
||||||
service.get_access_token("missing-state-account")
|
service.get_access_token("missing-state-account")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ def test_get_access_token_raises_when_access_token_empty():
|
||||||
fake_account.state.val.access_token = ""
|
fake_account.state.val.access_token = ""
|
||||||
service = _service_with_account(fake_account)
|
service = _service_with_account(fake_account)
|
||||||
|
|
||||||
with pytest.raises(ValueError, match="No access_token.*missing-token-account"):
|
with pytest.raises(ValueError, match=r"No access_token.*missing-token-account"):
|
||||||
service.get_access_token("missing-token-account")
|
service.get_access_token("missing-token-account")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ def test_get_access_token_raises_when_access_token_none():
|
||||||
fake_account.state.val.access_token = None
|
fake_account.state.val.access_token = None
|
||||||
service = _service_with_account(fake_account)
|
service = _service_with_account(fake_account)
|
||||||
|
|
||||||
with pytest.raises(ValueError, match="No access_token.*none-token-account"):
|
with pytest.raises(ValueError, match=r"No access_token.*none-token-account"):
|
||||||
service.get_access_token("none-token-account")
|
service.get_access_token("none-token-account")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue