From 7ee10c2c92d43c5f72729d987f140536a781c569 Mon Sep 17 00:00:00 2001 From: sigma67 Date: Mon, 18 May 2020 16:42:03 +0200 Subject: [PATCH] Update coverage instructions and badge --- tests/README.rst | 14 ++++++++++---- tests/coverage.svg | 6 +++--- tests/test.cfg.example | 2 +- tests/test.py | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/README.rst b/tests/README.rst index 831babe..f344592 100644 --- a/tests/README.rst +++ b/tests/README.rst @@ -11,12 +11,18 @@ Adjust the file to contain appropriate information for your YouTube account and Coverage badge -------------- -Install ``coverage`` and ``coverage-badge`` with pip. Run +Make sure you installed the dev requirements as explained in `CONTRIBUTING.rst `_. Run -``coverage run --source=ytmusicapi -m unittest discover tests`` +.. code-block:: bash -to generate a coverage report in the project root. With + cd tests + coverage run --source=../ytmusicapi -m unittest test.py -``coverage-badge -o tests/coverage.svg -f`` + +to generate a coverage report. With + +.. code-block:: bash + + coverage-badge -o coverage.svg -f you generate the badge. \ No newline at end of file diff --git a/tests/coverage.svg b/tests/coverage.svg index b6c4e36..59d64b3 100644 --- a/tests/coverage.svg +++ b/tests/coverage.svg @@ -9,13 +9,13 @@ - + coverage coverage - 95% - 95% + 93% + 93% diff --git a/tests/test.cfg.example b/tests/test.cfg.example index 1e86e39..ca6d3da 100644 --- a/tests/test.cfg.example +++ b/tests/test.cfg.example @@ -7,4 +7,4 @@ headers_file = ./headers_auth.json own = owned_playlist_id [uploads] -file = song_in_project_root.mp3 \ No newline at end of file +file = song_in_tests_directory.mp3 \ No newline at end of file diff --git a/tests/test.py b/tests/test.py index 91fd995..e8d4992 100644 --- a/tests/test.py +++ b/tests/test.py @@ -109,7 +109,7 @@ class TestYTMusic(unittest.TestCase): def test_get_owned_playlist(self): playlist = youtube_auth.get_playlist(config['playlists']['own'], 300) - self.assertEqual(len(playlist['tracks']), 284) + self.assertEqual(len(playlist['tracks']), 282) def test_edit_playlist(self): playlist = youtube_auth.get_playlist(config['playlists']['own'])