From 1557d1787756d099094eada65ac49b09864ec95f Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Wed, 4 Jun 2014 18:22:28 +0200 Subject: [PATCH] Added documentation to the test cases --- tests/test_pipeline.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index 9500272..f1fab36 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -1,8 +1,10 @@ import copy import unittest -from FourmiCrawler import pipelines, spider, items + from scrapy.exceptions import DropItem +from FourmiCrawler import pipelines, spider, items + class TestPipelines(unittest.TestCase): @@ -10,6 +12,7 @@ class TestPipelines(unittest.TestCase): self.testItem = items.Result() def test_NonePipeline(self): + #Testing the pipeline that replaces the None values in items. self.testItem["value"] = "abc" pipe = pipelines.RemoveNonePipeline() processed = pipe.process_item(self.testItem, spider.FourmiSpider()) @@ -22,6 +25,7 @@ class TestPipelines(unittest.TestCase): self.assertIs(processed[key], "") def test_DuplicatePipeline(self): + #Testing the pipeline that removes duplicates. self.testItem["attribute"] = "test" self.testItem["value"] = "test" self.testItem["conditions"] = "test" @@ -35,6 +39,7 @@ class TestPipelines(unittest.TestCase): self.assertEqual(pipe.process_item(otherItem, spider.FourmiSpider()), otherItem) def test_AttributeSelection(self): + #Testing the pipeline that selects attributes. item1 = copy.deepcopy(self.testItem) item2 = copy.deepcopy(self.testItem)