Skip to content

Commit

Permalink
Update mol.combine tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avirshup committed May 24, 2017
1 parent e7c8965 commit 7bc4783
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions moldesign/_tests/test_copies.py
Expand Up @@ -130,11 +130,22 @@ def test_molecule_copy(fixture_key, request):
assert mol.integrator == newmol.integrator


def test_molecular_combination(pdb3aid):
m2 = pdb3aid.copy()
newmol = pdb3aid.combine(m2)
assert newmol.num_chains == 2 * pdb3aid.num_chains
@pytest.mark.parametrize('fixturename', 'pdb3aid h2'.split())
def test_molecular_combination_chains(request, fixturename):
mol = request.getfuncargvalue(fixturename)
m2 = mol.copy()
newmol = mol.combine(m2)
assert newmol.num_chains == 2*mol.num_chains
assert len(set(chain for chain in newmol.chains)) == newmol.num_chains
_assert_unique_chainids(newmol)


def _assert_unique_chainids(mol):
chain_names = set()
for chain in mol.chains:
assert chain.name == chain.pdbindex
assert chain.name not in chain_names
chain_names.add(chain.name)


def test_chain_rename(pdb3aid):
Expand Down

0 comments on commit 7bc4783

Please sign in to comment.