Also simplified the setup of the `readonly` value in the tests which
fixes a test ordering issue found using --random-order.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
Track item paths and album artpaths should be removed from results unless
INCLUDE_PATHS is set. This works for items but for albums the artpath is always
removed.
This patch makes the artpath removal conditional on INCLUDE_PATHS not being set
and includes a regression test. Note: the default value for INCLUDE_PATHS is
False so no changes will be seen by users unless they already have
INCLUDE_PATHS set.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
Added a test (test_get_stats) for the /stats web API.
This involved adding another item so that we can check both items and albums
are being counted correctly, which required a few small changes to some item
tests.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
Documentation says that ?expand does not need a value (i.e. ?expand=1 is wrong),
so the test is changed to reflect that syntax.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
Added test_get_album_details to test fetching /album/2?expand=1.
Also changed second album name to make tests more robust.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
self.lib.add ignores the "id" field from the entry being added and overwrites
it with the next free number. So remove the misleading id fields.
Add a test to confirm that the album query response contains the expected
album id number.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.
Goal is smoothing the transition to python 3.