Skip to content

Commit

Permalink
fix alkane test and refactor to match others
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyfothergill committed May 5, 2021
1 parent d20d642 commit 1253dff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 10 additions & 0 deletions grits/tests/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ def cg_p3ht(self, p3ht):

cg_p3ht = CG_Compound(p3ht, cg_beads)
return cg_p3ht

@pytest.fixture
def alkane(self):
chain = mb.load("CCC" * 4, smiles=True)
return chain

@pytest.fixture
def cg_alkane(self, alkane):
cg_chain = CG_Compound(alkane, {"_A": "CCC"})
return cg_chain
11 changes: 5 additions & 6 deletions grits/tests/test_finegrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ def test_backmapbonds(self, p3ht, cg_p3ht):
assert fg_p3ht.n_particles == p3ht.n_particles
assert fg_p3ht.n_bonds == p3ht.n_bonds

def test_alkane_chain(self):
chain = mb.load("CCC" * 4, smiles=True)
cg_chain = grits.CG_Compound(chain, {"_A", "CCC"})
fg_chain = backmap(cg_chain)
assert fg_chain.n_bonds == chain.n_bonds
assert fg_chain.n_particles == chain.n_particles
def test_alkane(self, alkane, cg_alkane):
fg_alkane = backmap(cg_alkane)

assert fg_alkane.n_bonds == alkane.n_bonds
assert fg_alkane.n_particles == alkane.n_particles

0 comments on commit 1253dff

Please sign in to comment.