increassed code coverage
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-18 23:52:20 -04:00
parent 209597432d
commit cf05777f2c
2 changed files with 17 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ def test_ingredient_regex():
)
def test_parse_recipe_name(mock_site, mock_page, mock_recipe, mock_url):
def test_parse_recipe_name(mock_site, mock_page, mock_recipe, mock_url, mock_blank_page,):
expected_name = mock_recipe.name
mock_recipe.name = None
@@ -76,10 +76,23 @@ def test_parse_recipe_name(mock_site, mock_page, mock_recipe, mock_url):
mock_site,
mock_page,
mock_recipe,
mock_url,
)
assert mock_recipe.name == expected_name
ex = None
try:
mock_recipe = scrape.parse_recipe_name(
mock_site,
mock_blank_page,
mock_recipe,
)
except Exception as e:
ex = e
url = {"site": mock_site.base_url, "recipe": mock_recipe.identifier}
assert str(e) == f"Could not extract recipe name: {url}"
assert ex
def test_ingredient_to_parts(mock_ingredient):
parts = scrape.ingredient_to_parts(mock_ingredient)
@@ -88,3 +101,4 @@ def test_ingredient_to_parts(mock_ingredient):
assert parts.instruction == ""
assert parts.ingredient == "water"
assert parts.supplement == None