Commit 25ff85b7 authored by joaorodrigues's avatar joaorodrigues
Browse files

Added test to check for proper read/write of PDBx/mmCIF files

parent 29d05aa7
...@@ -11,7 +11,29 @@ else: ...@@ -11,7 +11,29 @@ else:
class TestPdbxFile(unittest.TestCase): class TestPdbxFile(unittest.TestCase):
"""Test the PDBx/mmCIF file parser""" """Test the PDBx/mmCIF file parser"""
def test_FormatConversion(self):
"""Test conversion from PDB to PDBx"""
mol = PDBFile('systems/ala_ala_ala.pdb')
# Write to 'file'
output = StringIO()
PDBxFile.writeFile(mol.topology, mol.positions, output,
keepIds=True)
# Read from 'file'
input = StringIO(output.getvalue())
try:
pdbx = PDBxFile(input)
except Exception:
self.fail('Parser failed to read PDBx/mmCIF file')
# Close file handles
output.close()
input.close()
def test_Triclinic(self): def test_Triclinic(self):
"""Test parsing a file that describes a triclinic box.""" """Test parsing a file that describes a triclinic box."""
pdb = PDBxFile('systems/triclinic.pdbx') pdb = PDBxFile('systems/triclinic.pdbx')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment