This commit is contained in:
@@ -10,7 +10,6 @@ import logging
|
|||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
def parse_ingredient(ingredient_text):
|
def parse_ingredient(ingredient_text):
|
||||||
|
|
||||||
units = ['teaspoon', 'tablespoon', 'gram', 'ounce', 'jar', 'cup', 'pinch',
|
units = ['teaspoon', 'tablespoon', 'gram', 'ounce', 'jar', 'cup', 'pinch',
|
||||||
'container', 'slice', 'package', 'pound', 'can', 'dash', 'spear',
|
'container', 'slice', 'package', 'pound', 'can', 'dash', 'spear',
|
||||||
'bunch', 'quart', 'cube', 'envelope', 'square', 'sprig', 'bag',
|
'bunch', 'quart', 'cube', 'envelope', 'square', 'sprig', 'bag',
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
from recipe_graph import scrape
|
from recipe_graph import scrape
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
def test_load_recipe():
|
||||||
|
page = scrape.load_recipe("https://hs.andreistoica.ca:4943")
|
||||||
|
assert type(page) == BeautifulSoup
|
||||||
|
|
||||||
|
page = scrape.load_recipe("https://hs.andreistoica.ca:4943/some-nonesense")
|
||||||
|
assert page == None
|
||||||
Reference in New Issue
Block a user