removed commented code and add test for error handling

This commit is contained in:
Daniel Collins 2015-08-29 12:29:01 -07:00 committed by Daniel Collins
parent 1f95af3c07
commit 425e35ee90
2 changed files with 5 additions and 3 deletions

View File

@ -115,9 +115,6 @@ class ItemLoader(object):
if value is not None:
item[field_name] = value
# for loader in self._subloaders:
# loader.load_item()
return item
def get_output_value(self, field_name):

View File

@ -707,6 +707,11 @@ class SubselectorLoaderTest(unittest.TestCase):
self.assertEqual(item['url'], [u'http://www.scrapy.org'])
self.assertEqual(item['image'], [u'/images/logo.png'])
def test_nested_bad_arguments(self):
l = NestedItemLoader(response=self.response)
with self.assertRaises(ValueError):
l.nested_loader(css="#id", xpath="//footer")
class SelectJmesTestCase(unittest.TestCase):
test_list_equals = {