HomeSoftware Heritage

tests: refactor SingleDbTestFixture class to add generic db initialization

Description

tests: refactor SingleDbTestFixture class to add generic db initialization

based on sql files shipped within the python package. This require several
small refactorings of SingleDbTestFixture.setUpClass and .add_db() methods:

  • replace the 2 arguments (dump, dump_type) by a single 'dumps' one; this later must be an iterable of couples (dump_file, dump_type)
  • refactor all needed helper functions accordingly.

We also add a small helper function to sort numerical file names, and provide a
DB_DUMP_TYPES as a global variable to prepare the next commit in which a new
cli tool 'swh-db-init' is added.

Related to T1265.

Details

Provenance
douarddaAuthored on Oct 15 2018, 10:16 AM
douarddaPushed on Oct 17 2018, 3:44 PM
Differential Revision
D538: refactor SingleDbTestFixture class to add generic db initialization
Parents
rDCORE417ae2548b78: tests: make TEST_DB_DUMP_TYPE guessed from TEST_DB_DUMP by default
Branches
Unknown
Tags
Unknown