Пример #1
0
def clients(tmpdir):
    c1 = util.temporary_directory(tmpdir)
    c2 = util.temporary_directory(tmpdir)
    server = util.temporary_directory(tmpdir)

    util.initialize_bare_repository(server)
    util.clone_repository(server, c1 / '.')
    util.clone_repository(server, c2 / '.')

    util.make_file(c1 / 'foo.json')

    c1 = GitSyncer(c1)
    c2 = GitSyncer(c2)
    return c1, c2
Пример #2
0
 def test_nup133_modeller(self):
     """Test the Nup133 example Modeller script"""
     with util.temporary_directory() as td:
         testdir = os.path.join(td, 'nup133')
         shutil.copytree(FOXSDIR, testdir)
         c = [sys.executable, 'add-missing-residues.py']
         print(" ".join(c))
         subprocess.check_call(c, shell=False, cwd=testdir)
         expected = ['3KFO-fill.ini', '3KFO-fill.rsr', '3KFO-fill.sch']
         for i in range(1, 6):
             for pattern in ('3KFO-fill.D0000000%d', '3KFO-fill.V9999000%d',
                             '3KFO-fill.B9999000%d.pdb'):
                 expected.append(pattern % i)
         for e in expected:
             os.unlink(os.path.join(testdir, e))
Пример #3
0
 def test_rpa(self):
     """Test the MultiFoXS RPA example"""
     with util.temporary_directory() as td:
         topdir = os.path.join(td, 'top')
         testdir = os.path.join(topdir, 'multi_foxs', 'rpa')
         shutil.copytree(TOPDIR, topdir)
         subprocess.check_call("./multifoxs.sh", shell=True, cwd=topdir)
         expected = [
             'cluster_representatives.txt', 'multi_state_model_1_1_1.dat',
             'multi_state_model_1_2_1.dat', 'multi_state_model_1_3_1.dat',
             'ensembles_size_1.txt', 'multi_state_model_2_1_1.dat',
             'multi_state_model_2_2_1.dat', 'ensembles_size_2.txt',
             'multi_state_model_3_1_1.dat', 'ensembles_size_3.txt'
         ]
         for e in expected:
             os.unlink(os.path.join(testdir, e))
Пример #4
0
def filesystem(tmpdir):
    root = util.temporary_directory(tmpdir)

    (root / 'server').mkdir()
    util.initialize_bare_repository(root / 'server')

    (root / 'client_1').mkdir()
    util.clone_repository(root / 'server', root / 'client_1')

    (root / 'client_2').mkdir()
    util.clone_repository(root / 'server', root / 'client_2')

    (root / 'repo').mkdir()
    util.initialize_repository(root / 'repo')

    (root / 'notrepo').mkdir()

    return root
Пример #5
0
 def test_nup133(self):
     """Test the FoXS Nup133 example"""
     with util.temporary_directory() as td:
         topdir = os.path.join(td, 'top')
         testdir = os.path.join(topdir, 'foxs', 'nup133')
         shutil.copytree(TOPDIR, topdir)
         subprocess.check_call("./foxs.sh", shell=True, cwd=topdir)
         with open(os.path.join(testdir, '3KFO_23922_merge.dat')) as fh:
             lines = fh.readlines()
         self.assertIn('Chi^2 = 8.76', lines[1])
         with open(
                 os.path.join(testdir,
                              '3KFO-fill.B99990005_23922_merge.dat')) as fh:
             lines = fh.readlines()
         self.assertIn('Chi^2 = 1.31', lines[1])
         expected = [
             '3KFO_23922_merge.dat', '3KFO-fill.B99990005_23922_merge.dat',
             'fit.plt', 'profiles.plt', 'fit.png'
         ]
         for e in expected:
             os.unlink(os.path.join(testdir, e))
Пример #6
0
def database_path(data, tmpdir):
    path = util.temporary_directory(tmpdir) / 'database.json'
    with path.open('w') as database_file:
        serialize(database_file, data)
    return path