mirror of https://github.com/scrapy/scrapy.git
removed commented code and add test for error handling
This commit is contained in:
parent
1f95af3c07
commit
425e35ee90
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue