- 08 Mar, 2021 2 commits
-
-
David Runge authored
repo_management/files.py: Add the private method `_extract_db_member_package_name()` which can be used to extract the package name from the name of a member of repository database. Rename `_read_db_file_member()` to `_db_file_member_as_model()` and change the method to yield a `models.RepoDbMemberData` instead of a `tarfile.TarInfo` to provide actual data (and required context) to callers of the method. tests/test_file.py: Add parametrized test for `_extract_db_member_package_name()`. Change test for `_db_file_member_as_model()` to assert the correct return type.
-
David Runge authored
repo_management/files.py: Add iterator method `_read_db_file_member()` to yield the members of a provided tarfile.TarFile. The members are filtered by name using a regular expression, which can be overridden. tests/test_file.py: Change `create_db_file()` to also create 'desc' and 'files' files below the created temporary directories. Assert, that all tested methods return a value. Add test for `_read_db_file_member()`.
-
- 07 Mar, 2021 1 commit
-
-
David Runge authored
repo_management/files.py: Add `_read_db_file()` to open a db file and return it as tarfile.Tarfile. The method assumes gzip-compressed databases by default, but can be used with other compression algorithms. tests/test_file.py: Add fixtures and tests for `_read_db_file()`.
-