def test_dump_tree(): """Dump the repository and check if files exist""" dumpdir = TMPDIR.join("dump") os.mkdir(dumpdir) ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True)) ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME))) ok_(os.path.exists(os.path.join(dumpdir, TESTDIR_NAME, TESTFILE_NAME))) ok_(os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name, TESTFILE_NAME))) # No submodules or subdirs if recursive is False dumpdir = TMPDIR.join("dump2") os.mkdir(dumpdir) ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True, False)) ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME))) ok_(not os.path.exists(os.path.join(dumpdir, TESTDIR_NAME))) ok_(not os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name)))
def test_dump_tree(): """Dump the repository and check if files exist""" dumpdir = os.path.join(tmpdir, "dump") os.mkdir(dumpdir) assert buildpackage.dump_tree(repo, dumpdir, "master", True) assert os.path.exists(os.path.join(dumpdir, testfile_name)) assert os.path.exists(os.path.join(dumpdir, submodules[0].name, testfile_name))
def test_dump_tree(): """Dump the repository and check if files exist""" dumpdir = TMPDIR.join("dump") os.mkdir(dumpdir) ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True)) ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME))) ok_(os.path.exists(os.path.join(dumpdir, TESTDIR_NAME, TESTFILE_NAME))) ok_( os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name, TESTFILE_NAME))) # No submodules or subdirs if recursive is False dumpdir = TMPDIR.join("dump2") os.mkdir(dumpdir) ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True, False)) ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME))) ok_(not os.path.exists(os.path.join(dumpdir, TESTDIR_NAME))) ok_(not os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name)))
def test_dump_tree(): """Dump the repository and check if files exist""" dumpdir = TMPDIR.join("dump") os.mkdir(dumpdir) ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True)) ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME))) ok_(os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name, TESTFILE_NAME)))