From 137aea61b8df398074054c88f7543988f6d10a1a Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 30 May 2023 15:45:58 +0200 Subject: [PATCH] Adding test to get_qualify_version --- tests/config_loader/basic_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/config_loader/basic_test.py b/tests/config_loader/basic_test.py index 4bddbed..03b059e 100644 --- a/tests/config_loader/basic_test.py +++ b/tests/config_loader/basic_test.py @@ -1,4 +1,5 @@ # coding: utf-8 +from scraper.src.config.version import __version__, qualified_version from scraper.src.config.config_loader import ConfigLoader from .abstract import config import pytest @@ -48,3 +49,14 @@ def test_excpetion_when_shadowing_(self): with pytest.raises(Exception): ConfigLoader(c) + + def test_get_qualified_version(self): + """ Old variable scrap_url must be spread to scrape_url. If one is defined, the previous one must be used""" + # Given + c = config({ + 'user_agent': qualified_version() + }) + + config_loaded = ConfigLoader(c) + + assert config_loaded.user_agent == f"Meilisearch DocsScraper (v{__version__})"