Ejemplo n.º 1
0
def test_site(path, tmpdir):
    """
    Test that sites in the examples/ directory build correctly
    """
    site = TarbellSite(path)

    assert os.path.realpath(site.path) == os.path.realpath(path)

    # build the site
    site.generate_static_site(str(tmpdir))

    # compare directories
    built = os.path.join(path, '_site')
    comp = filecmp.dircmp(built, str(tmpdir))

    assert set(comp.same_files) == set(os.listdir(built))