Skip to content

Commit

Permalink
overiding test filenames instead of using setUp function
Browse files Browse the repository at this point in the history
  • Loading branch information
khushhalm committed May 23, 2021
1 parent 96eacf9 commit a11d784
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
13 changes: 3 additions & 10 deletions tests/test_farmhousedelivery_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ class TestFarmhouseDeliveryScraper(ScraperTest):

scraper_class = FarmhouseDelivery

def setUp(self):
os.environ[
"RECIPE_SCRAPERS_SETTINGS"
] = "tests.test_data.test_settings_module.test_settings"

with open(
"tests/test_data/{}_1.testhtml".format(self.scraper_class.__name__.lower()),
encoding="utf-8",
) as testfile:
self.harvester_class = self.scraper_class(testfile)
@property
def test_file_name(self):
return "{}_1".format(self.scraper_class.__name__.lower())

def test_host(self):
self.assertEqual("recipes.farmhousedelivery.com", self.harvester_class.host())
Expand Down
13 changes: 3 additions & 10 deletions tests/test_farmhousedelivery_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ class TestFarmhouseDeliveryScraper(ScraperTest):

scraper_class = FarmhouseDelivery

def setUp(self):
os.environ[
"RECIPE_SCRAPERS_SETTINGS"
] = "tests.test_data.test_settings_module.test_settings"

with open(
"tests/test_data/{}_2.testhtml".format(self.scraper_class.__name__.lower()),
encoding="utf-8",
) as testfile:
self.harvester_class = self.scraper_class(testfile)
@property
def test_file_name(self):
return "{}_2".format(self.scraper_class.__name__.lower())

def test_host(self):
self.assertEqual("recipes.farmhousedelivery.com", self.harvester_class.host())
Expand Down

0 comments on commit a11d784

Please sign in to comment.