def test_requirements(self):
        expected0 = [
            {'extras': (),
             'key': 'dep2',
             'modules': None,
             'packages': None,
             'project_name': 'dep2',
             'repo_url': None,
             'resolved': False,
             'specs': [('==', '0.0')],
             'type': 'setuptools',
             'unsafe_name': 'dep2'},
            {'extras': (),
             'key': 'dep1',
             'modules': None,
             'packages': None,
             'project_name': 'dep1',
             'repo_url': None,
             'resolved': False,
             'specs': [],
             'type': 'setuptools',
             'unsafe_name': 'dep1'},
            {'extras': ('blah',),
             'key': 'dep3',
             'modules': None,
             'packages': None,
             'project_name': 'dep3',
             'repo_url': None,
             'resolved': False,
             'specs': [('>=', '0.0.4')],
             'type': 'setuptools',
             'unsafe_name': 'dep3'}
        ]
        testcases = [
            ('ex0', expected0),
            ('ex_nosetuppy', expected0),
            ('ex_norequirementstxt', expected0),
            ('ex_weirdsetuppy', expected0),
            ('ex_setuppy_prints', expected0),
            ('ex_nothing', '<<ERROR>>'),
            ('ex_requirementstxtvcs', [
                {'key': 'https://code.google.com/p/foo',
                 'repo_url': 'https://code.google.com/p/foo',
                 'type': 'vcs',
                 'modules': None, 'extras': None, 'packages': None, 'project_name': None, 'resolved': False,
                 'specs': None, 'unsafe_name': None},
                {'key': 'https://github.com/foo/bar',
                 'repo_url': 'https://github.com/foo/bar',
                 'type': 'vcs', 'extras': None, 'modules': None, 'packages': None, 'project_name': None,
                 'resolved': False, 'specs': None, 'unsafe_name': None},
                {'extras': (),
                 'key': 'foo',
                 'project_name': 'foo',
                 'type': 'setuptools',
                 'unsafe_name': 'foo',
                 'modules': None,
                 'packages': None,
                 'repo_url': None,
                 'resolved': False,
                 'specs': []}
            ]),
        ]
        for testcase in testcases:
            dir_, exp = testcase[0], testcase[1]
            rootdir = path.join(testdatadir, dir_)
            reqs, err = requirements(rootdir, resolve=False)
            if err is not None:
                if exp != '<<ERROR>>':
                    print('unexpected error: ', err)
                self.assertEqual(exp, '<<ERROR>>')
            else:
                self.assertListEqual(sorted(exp, key=lambda x: x['key']), sorted(reqs, key=lambda x: x['key']))
iterate through values with nested keys flattened into a tuple
dataset/ETHPy150Open sourcegraph/pydep/pydep/req_test.py/TestRequirements.test_requirements--crossover with--dataset/ETHPy150Open CGATOxford/cgat/CGAT/IOTools.py/nested_dict.iterflattened