Update tests README
This commit is contained in:
parent
c79f13ab92
commit
12c7c82521
2 changed files with 6 additions and 12 deletions
3
setup.py
3
setup.py
|
|
@ -28,8 +28,7 @@ setup(name='ytmusicapi',
|
||||||
'pre-commit',
|
'pre-commit',
|
||||||
'flake8',
|
'flake8',
|
||||||
'yapf',
|
'yapf',
|
||||||
'coverage',
|
'coverage'
|
||||||
'coverage-badge'
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
python_requires=">=3.5",
|
python_requires=">=3.5",
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,11 @@ Package tests
|
||||||
Tests use the ``unittest`` framework. Each function has a corresponding unittest.
|
Tests use the ``unittest`` framework. Each function has a corresponding unittest.
|
||||||
Sometimes there is a single unittest for multiple functions to ensure there are no permanent changes in the user's YouTube account (i.e. subscribe and unsubscribe).
|
Sometimes there is a single unittest for multiple functions to ensure there are no permanent changes in the user's YouTube account (i.e. subscribe and unsubscribe).
|
||||||
|
|
||||||
Note that there must be a ``headers_auth.json`` in the project root to run authenticated tests.
|
Note that there must be a ``headers_auth.json`` in the `tests` folder to run authenticated tests.
|
||||||
For testing the song upload, there also needs to be a file with the name specified in the code in the project root.
|
For testing the song upload, there also needs to be a file with the name specified in the code in the project root.
|
||||||
|
|
||||||
Copy ``tests/test.cfg.example`` to ``test.cfg`` in the project root to run tests with coverage.
|
Copy ``tests/test.cfg.example`` to ``tests/test.cfg`` to run the tests. The entry descriptions should be self-explanatory.
|
||||||
|
For the headers_raw, you need to indent the overflowing lines with a tab character. For the upload test you need a suitable music file in the test directory.
|
||||||
Adjust the file to contain appropriate information for your YouTube account and local setup.
|
Adjust the file to contain appropriate information for your YouTube account and local setup.
|
||||||
|
|
||||||
Coverage badge
|
Coverage badge
|
||||||
|
|
@ -16,13 +17,7 @@ Make sure you installed the dev requirements as explained in `CONTRIBUTING.rst <
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
cd tests
|
cd tests
|
||||||
coverage run --source=../ytmusicapi -m unittest test.py
|
coverage run -m unittest test.py
|
||||||
|
|
||||||
|
|
||||||
to generate a coverage report. With
|
to generate a coverage report.
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
coverage-badge -o coverage.svg -f
|
|
||||||
|
|
||||||
you generate the badge.
|
|
||||||
Loading…
Reference in a new issue