def test_pprint_blockers(self): simple = [['A']] fancy = [['A', 'B']] nutty = [['A', 'B', 'C']] repeated = [['A', 'C'], ['B']] # Also tests sorting. got = ciu_main.pprint_blockers(simple) self.assertEqual(list(got), ['A']) got = ciu_main.pprint_blockers(fancy) self.assertEqual(list(got), ['A (which is blocking B)']) got = ciu_main.pprint_blockers(nutty) self.assertEqual(list(got), ['A (which is blocking B, which is blocking C)']) got = ciu_main.pprint_blockers(repeated) self.assertEqual(list(got), ['B', 'A (which is blocking C)'])
def main(): logger = logging.getLogger("python_pa") py2_projects = caniusepython3.pypi.all_projects() py3_projects = caniusepython3.pypi.all_py3_projects() py2_only_projects = set(py2_projects).difference(set(py3_projects)) package_index = randint(0, len(py2_only_projects)) selected_package_name = list(py2_only_projects)[package_index] blockers = blocking_dependencies( [selected_package_name], py3_projects) print("Randomly Selected Package is {}".format(selected_package_name)) print(message(blockers)) print(pprint_blockers(blockers))