added parse_ingredient test
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
cf05777f2c
commit
a04bb06ed8
|
|
@ -67,6 +67,17 @@ def test_ingredient_regex():
|
|||
== "((?:[\\d\\./\\u00BC-\\u00BE\\u2150-\\u215E]*\\s?(?:\\(.+\\))?)*)((?:(?:[cC]up|[oO]unce)e?s?)?)((?:(?:(?:[cC]rushed|[gG]round)(?:ly)?)| )*)([a-zA-Z '\\-]+),?(.*)"
|
||||
)
|
||||
|
||||
def test_parse_ingredient(mock_ingredient):
|
||||
parts = scrape.parse_ingredient(mock_ingredient.text)
|
||||
assert len(parts) > 0
|
||||
assert parts == ['1', 'ounce', '', 'water', None]
|
||||
|
||||
parts = scrape.parse_ingredient("Water")
|
||||
assert len(parts) > 0
|
||||
assert parts == [None, None, None, 'Water', None]
|
||||
|
||||
parts = scrape.parse_ingredient("")
|
||||
assert parts == None
|
||||
|
||||
def test_parse_recipe_name(mock_site, mock_page, mock_recipe, mock_url, mock_blank_page,):
|
||||
expected_name = mock_recipe.name
|
||||
|
|
|
|||
Loading…
Reference in New Issue