def test_double_iter():
    class IterScraper(Scraper):
        def scrape(self):
            yield self.scrape_people()

        def scrape_people(self):
            p = Person('Michael Jordan')
            p.add_source('http://example.com')
            yield p

    with mock.patch('json.dump') as json_dump:
        record = IterScraper(juris, '/tmp/').do_scrape()

    assert len(json_dump.mock_calls) == 1
    assert record['objects']['person'] == 1
tests that scrapers that yield iterables work OK
dataset/ETHPy150Open opencivicdata/pupa/pupa/tests/scrape/test_scraper.py/test_double_iter