Skip to content

Commit

Permalink
fix drive tests (nit)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Dec 13, 2024
1 parent 616e997 commit 64f0ad8
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 364 deletions.
4 changes: 2 additions & 2 deletions backend/tests/daily/connectors/gmail/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def parse_credentials(env_str: str) -> dict:
@pytest.fixture
def google_gmail_oauth_connector_factory() -> Callable[..., GmailConnector]:
def _connector_factory(
primary_admin_email: str = "admin@onyx-test.com",
primary_admin_email: str = "admin@danswer-test.com",
) -> GmailConnector:
print("Creating GmailConnector with OAuth credentials")
connector = GmailConnector()
Expand All @@ -76,7 +76,7 @@ def _connector_factory(
@pytest.fixture
def google_gmail_service_acct_connector_factory() -> Callable[..., GmailConnector]:
def _connector_factory(
primary_admin_email: str = "admin@onyx-test.com",
primary_admin_email: str = "admin@danswer-test.com",
) -> GmailConnector:
print("Creating GmailConnector with service account credentials")
connector = GmailConnector()
Expand Down
26 changes: 14 additions & 12 deletions backend/tests/daily/connectors/gmail/test_gmail_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@

"""
This thread was 4 emails long:
admin@onyx-test.com -> [email protected] (conaining test_user_1 and test_user_2)
[email protected] -> admin@onyx-test.com
admin@onyx-test.com -> [email protected] + BCC: [email protected]
[email protected] -> admin@onyx-test.com
admin@danswer-test.com -> [email protected] (conaining test_user_1 and test_user_2)
[email protected] -> admin@danswer-test.com
admin@danswer-test.com -> [email protected] + BCC: [email protected]
[email protected] -> admin@danswer-test.com
"""
_THREAD_1_BY_ID: dict[str, dict[str, Any]] = {
"192edefb315737c3": {
"email": "admin@onyx-test.com",
"email": "admin@danswer-test.com",
"sections_count": 4,
"primary_owners": set(
[
"admin@onyx-test.com",
"admin@danswer-test.com",
"[email protected]",
"[email protected]",
]
),
"secondary_owners": set(
[
"[email protected]",
"admin@onyx-test.com",
"admin@danswer-test.com",
"[email protected]",
"[email protected]",
]
Expand All @@ -41,24 +41,26 @@
"192edf020d2f5def": {
"email": "[email protected]",
"sections_count": 2,
"primary_owners": set(["[email protected]", "[email protected]"]),
"secondary_owners": set(["[email protected]", "[email protected]"]),
"primary_owners": set(["[email protected]", "[email protected]"]),
"secondary_owners": set(
["[email protected]", "[email protected]"]
),
},
"192edf020ae90aab": {
"email": "[email protected]",
"sections_count": 2,
"primary_owners": set(["admin@onyx-test.com"]),
"primary_owners": set(["admin@danswer-test.com"]),
"secondary_owners": set(
["[email protected]", "[email protected]"]
),
},
"192edf18316015fa": {
"email": "[email protected]",
"sections_count": 2,
"primary_owners": set(["admin@onyx-test.com", "[email protected]"]),
"primary_owners": set(["admin@danswer-test.com", "[email protected]"]),
"secondary_owners": set(
[
"admin@onyx-test.com",
"admin@danswer-test.com",
"[email protected]",
"[email protected]",
]
Expand Down
4 changes: 2 additions & 2 deletions backend/tests/daily/connectors/google_drive/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@


_USER_TO_OAUTH_CREDENTIALS_MAP = {
"admin@onyx-test.com": "GOOGLE_DRIVE_OAUTH_CREDENTIALS_JSON_STR",
"admin@danswer-test.com": "GOOGLE_DRIVE_OAUTH_CREDENTIALS_JSON_STR",
"[email protected]": "GOOGLE_DRIVE_OAUTH_CREDENTIALS_JSON_STR_TEST_USER_1",
}

_USER_TO_SERVICE_ACCOUNT_CREDENTIALS_MAP = {
"admin@onyx-test.com": "GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON_STR",
"admin@danswer-test.com": "GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON_STR",
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"https://drive.google.com/drive/u/5/folders/1loe6XJ-pJxu9YYPv7cF3Hmz296VNzA33"
)

ADMIN_EMAIL = "admin@onyx-test.com"
ADMIN_EMAIL = "admin@danswer-test.com"
TEST_USER_1_EMAIL = "[email protected]"
TEST_USER_2_EMAIL = "[email protected]"
TEST_USER_3_EMAIL = "[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def slack_test_setup() -> Generator[tuple[dict[str, Any], dict[str, Any]], None, None]:
slack_client = SlackManager.get_slack_client(os.environ["SLACK_BOT_TOKEN"])
admin_user_id = SlackManager.build_slack_user_email_id_map(slack_client)[
"admin@onyx-test.com"
"admin@danswer-test.com"
]

(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_slack_permission_sync(

# Creating an admin user (first user created is automatically an admin)
admin_user: DATestUser = UserManager.create(
email="admin@onyx-test.com",
email="admin@danswer-test.com",
)

# Creating a non-admin user
Expand Down Expand Up @@ -231,7 +231,7 @@ def test_slack_group_permission_sync(

# Creating an admin user (first user created is automatically an admin)
admin_user: DATestUser = UserManager.create(
email="admin@onyx-test.com",
email="admin@danswer-test.com",
)

# Creating a non-admin user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_slack_prune(

# Creating an admin user (first user created is automatically an admin)
admin_user: DATestUser = UserManager.create(
email="admin@onyx-test.com",
email="admin@danswer-test.com",
)

# Creating a non-admin user
Expand Down
Loading

0 comments on commit 64f0ad8

Please sign in to comment.