'Ensure that the split-up test structure of ``build.yaml`` covers all
code in the Flocker repository.
This only makes sense when running out of a git checkout.
Caveats:
* This has no idea whether tests are actually being run in an
appropriate environment. E.g. maybe we\'re only running tests
that require root in non-root environment, and so they are
always skipped.
* Acceptance tests are run using different mechanism that
isn\'t well covered by this check.'

@skipUnless(('.git' in REPOSITORY.listdir()), 'Need    to    run    out    of    git    checkout.')
def test_build_yaml_includes_all_repository_tests(self):

    build_config = safe_load(REPOSITORY.child('build.yaml').getContent())
    configured_tests = pset()
    for jobs in build_config[u'job_type'].values():
        for job in jobs.values():
            for module in job.get(u'with_modules', []):
                configured_tests = (configured_tests | get_tests_for(module))
            module = job.get('module', None)
            if (module is not None):
                configured_tests = (configured_tests | get_tests_for(module))
    expected_tests = pset()
    for child in REPOSITORY.children():
        if (child.isdir() and ('__init__.py' in child.listdir())):
            expected_tests = (expected_tests | get_tests_for(child.basename()))
    self.assertTrue((configured_tests == expected_tests), 'Tests    that    are    unexpected    but    in    build.yaml:    {}\n\nTests    that    are    missing    from    build.yaml:    {}\n\n'.format(pformat(list((configured_tests - expected_tests))), pformat(list((expected_tests - configured_tests)))))
