Open tombola opened 1 year ago
Will need to mock external data sources:
Hopefully can provide a set of pytest marks (eg). that will run the corresponding recordings of live requests against local database. This would keep test more maintainable, as can re-run against new copy of database and commit the responses.
I have added mocking for WooCommerce, which will make testing that aspect simple and fast.
Next is testing the odbc connection* against an SQLite database in place of filemaker, and dumping some test data in there from the relevant filemaker tables, eg acquisitions, seed_lots, batches. Should include some non test data to catch edge cases.
Resources re odbc mock:
* pypyodbc unless I can build pyodbc against iodbc
First must check if SQL syntax used is equivalent between sqlite and FileMaker (🤞). Do this by constructing two simple tables in SQLite with as columns as per vs_tables.py
then take some generated SQL (eg from batch_upload.py
) and perform the (joined) query against sqlite instead.
Options for mocking:
To recreate fm in sqlite, could:
Should support the following testing