Skip to content

Commit

Permalink
MOD: CGPDB.
Browse files Browse the repository at this point in the history
  • Loading branch information
Moguf committed Oct 12, 2016
1 parent 6fc5295 commit 9cb5ef6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cafepy/files/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .ninfofile import Ninfo
from .dcdfile import DCD
from .pdbfile import PDB
from .pdbfile import PDB, CGPDB
from .indexfile import Index
2 changes: 1 addition & 1 deletion cafepy/files/pdbfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class CGPDB(CafePyBase, FileIO):
"""
Reading a Coarse-Grained PDB(Protein Data Bank) file which is an output from CafeMol Software.
"""
def __init__(self):
def __init__(self, filename):
pass


Expand Down
36 changes: 28 additions & 8 deletions test/test_pdbfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

cafepypath = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(cafepypath)
from cafepy.files import PDB
from cafepy.files import PDB, CGPDB

class TestPDB(unittest.TestCase):
@classmethod
Expand All @@ -28,14 +28,14 @@ def test_readPDB_with_index(self):
def test_readPDB_with_terminal_slices(self):
self.assertEqual(self.pdb[:2], self.pdblist[:2])

def test_readPDB_with_terminal_slices(self):
def test_readPDB_with_terminal_slices1(self):
self.assertEqual(self.pdb[1:4], self.pdblist[1:4])

def test_readPDB_with_terminal_slices(self):
self.assertEqual(self.pdb[:2], self.pdblist[:2])
def test_readPDB_with_terminal_slices2(self):
self.assertEqual(self.pdb[:-1], self.pdblist[:-1])

def test_readPDB_with_terminal_slices(self):
self.assertEqual(self.pdb[:2], self.pdblist[:2])
def test_readPDB_with_terminal_slices3(self):
self.assertEqual(self.pdb[::], self.pdblist[::])


def test_len(self):
Expand All @@ -50,7 +50,27 @@ def tearDownClass(cls):
pass

class TestCGPDB(unittest.TestCase):
pass
@classmethod
def setUpClass(cls):
cls.testdata = os.path.join(os.path.dirname(__file__), 'data/cgtest.pdb')
cls.listdata = os.path.join(os.path.dirname(__file__), 'data/')
sys.path.append(cls.listdata)
cls.cgpdb = CGPDB(cls.testdata)

def tearDown(self):
pass

def test_read_cgpdb(self):


@classmethod
def tearDownClass(cls):
pass



if __name__ == "__main__":
unittest.main()
suite1 = unittest.TestLoader().loadTestsFromTestCase(TestPDB)
suite2 = unittest.TestLoader().loadTestsFromTestCase(TestCGPDB)
suite = unittest.TestSuite([suite1, suite2])
unittest.TextTestRunner(verbosity=2).run(suite)

0 comments on commit 9cb5ef6

Please sign in to comment.