def test_docs(self, module): tasks = _nb._get_tasks(module) assert 4 == len(tasks) for task_ in tasks: assert task_.name in self.docs assert self.docs[task_.name] == task_.doc
def test_get_tasks(self): from .build_scripts import dependencies tasks = _nb._get_tasks(dependencies) assert len(tasks) == 5 assert 3 == len([task for task in tasks if task.name == 'android'][0].dependencies) assert 3 == len([task for task in tasks if task.name == 'ios'][0].dependencies)
def test_dependencies_for_imported(self): from .build_scripts import default_task_and_import_dependencies tasks = _nb._get_tasks(default_task_and_import_dependencies) assert 7 == len(tasks) assert [task for task in tasks if task.name == 'clean'] assert [task for task in tasks if task.name == 'local_task'] assert [task for task in tasks if task.name == 'android'] assert 3 == len([ task for task in tasks if task.name == 'task_with_imported_dependencies' ][0].dependencies)
def test_list_docs(self, module, args): with mock_stdout() as out: build(module, args) stdout = out[0] tasks = _nb._get_tasks(module) for task in tasks: if task.ignored: assert re.findall( r"%s\s+%s\s+%s" % (task.name, r"\[Ignored\]", task.doc), stdout) else: assert re.findall(r"%s\s+%s" % (task.name, task.doc), stdout)
def test_get_tasks(self): from .build_scripts import simple ts = _nb._get_tasks(simple) assert len(ts) == 5