-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
0 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,11 +48,6 @@ def prometheus_password(): | |
return "super_secure" | ||
|
||
|
||
@pytest.fixture | ||
def account_id_hashing_key(): | ||
return "super_secure" | ||
|
||
|
||
@pytest.fixture | ||
def email_source_address(): | ||
return "[email protected]" | ||
|
@@ -83,33 +78,17 @@ def client( | |
mock_ses_client, | ||
admin_email, | ||
jwt_encryption_key, | ||
account_id_hashing_key, | ||
prometheus_password, | ||
email_source_address, | ||
): | ||
app.dependency_overrides[get_settings] = make_override_get_settings( | ||
jwt_encryption_key=jwt_encryption_key, | ||
prometheus_metrics_password=prometheus_password, | ||
email_source_address=email_source_address, | ||
account_id_hashing_key=account_id_hashing_key, | ||
aws_access_key_id="ITSCHANGED", | ||
admin_emails=[admin_email], | ||
aws_secret_access_key="ITSCHANGED", | ||
) | ||
mock_clickhouse = MagicMock() | ||
mock_clickhouse.execute = MagicMock() | ||
|
||
# rows, coldata = q | ||
# coldata = [("name", "type")] | ||
def mock_execute(query, query_params, with_column_types, settings): | ||
assert with_column_types == True | ||
assert query.startswith("SELECT role FROM") | ||
if query_params["account_id"] == hash_email_address( | ||
email_address=admin_email, key=account_id_hashing_key | ||
): | ||
return [("admin",)], [("role", "String")] | ||
|
||
return [("user",)], [("role", "String")] | ||
|
||
client = TestClient(app) | ||
yield client |