You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RepositorySimulator: add trackers/counters for downloaded files #1682
Description of issue or feature request:
There is a need in some test cases to check whether Updater requested the correct files from the repository.
For a concrete use case see #1666.
One option used in #1666 is to use unittest.mock and "wrap" RepositorySimulator._fetch_* methods which does the job but does make the tests less readable.
Therefore as an alternative, proposed by @jku#1666 (review), checking that the expected files are downloaded from remote can be done by adding some download counters into RepositorySimulator which would be cleaner and more maintainable
repositorysimulator keeps lists of requests (I guess one for metadata, one for targets makes sense). It adds an item to list every time a request is made
tests can at any time check that the list is what they expect
tests can also clear the list when they want
the format of the lists should be whatever makes most sense for the test code (urls? metadata role names? 🤷)
Activity
kairoaraujo commentedon Nov 24, 2021
I will work on it.
jku commentedon Nov 24, 2021
basically my idea was that
Implemented call_stats to RepositorySimulator
Implemented call_stats to RepositorySimulator
Implemented fetch_tracker to RepositorySimulator
Implemented fetch_tracker to RepositorySimulator
Implemented fetch_tracker to RepositorySimulator
Implemented fetch_tracker to RepositorySimulator