Open abegong opened 6 years ago
There are lots of places in the unit tests where we do this: assert pair.add_dataset_from_pandas_df(pandas_df, 1, filename='etp_participant_data')
assert pair.add_dataset_from_pandas_df(pandas_df, 1, filename='etp_participant_data')
This verifies that the code runs without error, but says nothing about the content of the response.
In this case, the response is something like:
{ "dataset": { "id": "RGF0YXNldDoxMzE=", "project": { "id": "UHJvamVjdDox" }, "createdBy": { "id": "VXNlcjo3" }, "filename": "etp_participant_data_orgID-None", "s3Key": "ef1de6a6-a3f3-4dc5-9ccd-6c79880f4c0detp_participant_data_orgID-None", "organization": null } }
The structure of this response would make a good test case. Most of the specific values (e.g. filename, s3Key, all the ids, etc.) would not.
It would be great to have a function to assert that two nested dictionaries share the same keys. We could use it all over test_pair.py to:
jsonschema could do 1 but not 2.
There are lots of places in the unit tests where we do this:
assert pair.add_dataset_from_pandas_df(pandas_df, 1, filename='etp_participant_data')
This verifies that the code runs without error, but says nothing about the content of the response.
In this case, the response is something like:
The structure of this response would make a good test case. Most of the specific values (e.g. filename, s3Key, all the ids, etc.) would not.
It would be great to have a function to assert that two nested dictionaries share the same keys. We could use it all over test_pair.py to: