Skip to content

Commit

Permalink
package and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Nov 22, 2023
1 parent ce8ae50 commit a10c9a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions posthog/temporal/tests/test_external_data_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from posthog.warehouse.data_load.pipeline import StripeJobInputs, SourceColumnType, SourceSchema
from posthog.warehouse.data_load.service import ExternalDataJobInputs
from posthog.warehouse.data_load.stripe import ENDPOINTS

from posthog.temporal.data_imports.external_data_job import (
create_external_data_job_model,
Expand Down Expand Up @@ -119,7 +120,7 @@ async def test_run_stripe_job(activity_environment, team, **kwargs):
dataset_name=new_source.draft_folder_path,
)
)
mock_run_stripe.assert_called_once_with(stripe_secret_key="test-key")
mock_run_stripe.assert_called_once_with(stripe_secret_key="test-key", endpoints=ENDPOINTS)
assert len(schemas) == 1


Expand Down Expand Up @@ -159,7 +160,7 @@ async def test_is_schema_valid_activity(activity_environment, team, **kwargs):
),
)

assert mock_get_columns.call_count == 1
assert mock_get_columns.call_count == 5


@pytest.mark.django_db(transaction=True)
Expand Down Expand Up @@ -240,10 +241,10 @@ async def test_create_schema_activity(activity_environment, team, **kwargs):
),
)

assert mock_get_columns.call_count == 4
assert mock_get_columns.call_count == 5
all_tables = DataWarehouseTable.objects.all()
table_length = await sync_to_async(len)(all_tables)
assert table_length == 4
assert table_length == 5

# Should still have one after
await activity_environment.run(
Expand All @@ -268,7 +269,7 @@ async def test_create_schema_activity(activity_environment, team, **kwargs):
all_tables = DataWarehouseTable.objects.all()
table_length = await sync_to_async(len)(all_tables)

assert table_length == 4
assert table_length == 5


@pytest.mark.django_db(transaction=True)
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ django-revproxy==0.12.0
djangorestframework==3.14.0
djangorestframework-csv==2.1.1
djangorestframework-dataclasses==1.2.0
django-fernet-encrypted-fields==0.1.2
django-fernet-encrypted-fields==0.1.3
dlt==0.3.24
dnspython==2.2.1
drf-exceptions-hog==0.4.0
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ django-deprecate-fields==0.1.1
# via -r requirements.in
django-extensions==3.1.2
# via -r requirements.in
django-fernet-encrypted-fields==0.1.2
django-fernet-encrypted-fields==0.1.3
# via -r requirements.in
django-filter==2.4.0
# via -r requirements.in
Expand Down Expand Up @@ -243,7 +243,6 @@ giturlparse==0.12.0
# via dlt
google-api-core[grpc]==2.11.1
# via
# google-api-core
# google-cloud-bigquery
# google-cloud-core
google-auth==2.22.0
Expand Down

0 comments on commit a10c9a6

Please sign in to comment.