diff --git a/.gitignore b/.gitignore index eba8e8f..6806920 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +cassettes client.py .coverage htmlcov diff --git a/requirements-dev.txt b/requirements-dev.txt index 6c6bf80..4e67882 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,4 +6,5 @@ pylint pyproject-flake8 pytest pytest-cov +pytest-vcr toml diff --git a/tests_ldpy.py b/tests_ldpy.py index 14a7eff..cf57fdd 100644 --- a/tests_ldpy.py +++ b/tests_ldpy.py @@ -9,6 +9,7 @@ Author: frederic zind 2022-09-24 Licenses: GNU AGPL v3: http://www.gnu.org/licenses/ """ import logging +import pytest from pytest import mark, raises import ldpy @@ -128,6 +129,7 @@ def test_get_last_entries_out_of_range(entry_np): ldpy.get_last_entries(entry_np) +@pytest.mark.vcr() @mark.parametrize("entry_np", LAST_E_CHOICES) def test_get_last_entries_in_range(entry_np): """Value is in range for the last entries.""" @@ -146,6 +148,7 @@ def test_main_without_option(): ldpy.main(options) +@pytest.mark.vcr() def test_main_demo_with_mapping(): """Called with mapping option. @@ -157,6 +160,7 @@ def test_main_demo_with_mapping(): assert isinstance(response, list) +@pytest.mark.vcr() def test_main_demo_with_last_const(): """Called with last option.""" options = FakeOptions(["last"])