Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Nov 3, 2021
1 parent 1c1279a commit e0cea70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/integration_tests/csv_upload_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def get_upload_db():

def upload_csv(filename: str, table_name: str, extra: Optional[Dict[str, str]] = None):
csv_upload_db_id = get_upload_db().id
schema = utils.get_example_default_schema()
form_data = {
"csv_file": open(filename, "rb"),
"sep": ",",
Expand All @@ -130,7 +131,6 @@ def upload_csv(filename: str, table_name: str, extra: Optional[Dict[str, str]] =
"index_label": "test_label",
"mangle_dupe_cols": False,
}
schema = utils.get_example_default_schema()
if schema:
form_data["schema"] = schema
if extra:
Expand Down Expand Up @@ -211,7 +211,7 @@ def test_import_csv_enforced_schema(mock_event_logger):
full_table_name = f"admin_database.{CSV_UPLOAD_TABLE_W_SCHEMA}"

# no schema specified, fail upload
resp = upload_csv(CSV_FILENAME1, CSV_UPLOAD_TABLE_W_SCHEMA)
resp = upload_csv(CSV_FILENAME1, CSV_UPLOAD_TABLE_W_SCHEMA, extra={"schema": None})
assert (
f'Database "{CSV_UPLOAD_DATABASE}" schema "None" is not allowed for csv uploads'
in resp
Expand Down

0 comments on commit e0cea70

Please sign in to comment.