Closed thinkjrs closed 4 years ago
test_album.py::test_charts
Working! And..not working! What?
Something's happening to auth as we're getting 403's when using certain dates. However, if sticking to exactly those combinations used in the documentation tests will pass.
I recommend putting a logging.warning in .artist.charts
, for now.
The "until" date--we used 2020 in the failing and 2019 in the passing.
Added a slowdown and code coverage in commit c6befd10f and de6381bc467 .
Commentary for more cohesive testing of api combinations, above.
Map key:value pairs
Essentially, we need to grab the possible keys from the chartmetric documentation for each endpoint and then for each key list their possible values.
We should also have a "randomizer" for ids used for testing, controlled from a single place. As in:
pytest.fixture(scope='module')
def getTestData():
return dict(
test_artists = ['artist1cmid', 'artist2cmid'],
test_tracks = [...],
test_somethingWithAnID = [...],
)
pytest.fixture(scope='module')
def data(getTestData):
return dict(
test_artist=random.choice(getTestData['test_artists']),
...,
)
Also, coverage:
Okay, so the coverage above included our test coverage for tests, as I forgot to exclude the tests/
dir in the configuration:
coverage
Much, much better, and closer to what's expected.
Some of our tests have been failing for a while and there were a few deprecations upstream since I've worked on this client.
Update deprecated tests
Fix failing tests
Or comment & explain failing tests & remove functionality
Cleanup tests
Our tests need a number of new things:
confest.py
w/reusable fixturesIn addition, our current tests need updating: ~- [ ] add modern type hints~