1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
import utils
import os
import unittest
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TOPDIR)
import modelcif.model
class Tests(unittest.TestCase):
def test_model(self):
"""Test Model classes"""
m = modelcif.model.HomologyModel([])
self.assertEqual(m.model_type, "Homology model")
self.assertIsNone(m.other_details)
# generic "other" model
m = modelcif.model.Model([])
self.assertEqual(m.model_type, "Other")
self.assertIsNone(m.other_details)
# custom "other" model
class CustomRef(modelcif.model.Model):
"""foo
bar"""
m = CustomRef([])
self.assertEqual(m.model_type, "Other")
self.assertEqual(m.other_details, "foo")
if __name__ == '__main__':
unittest.main()
|