File: test_model.py

package info (click to toggle)
python-modelcif 1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 688 kB
  • sloc: python: 6,746; makefile: 14; sh: 6
file content (33 lines) | stat: -rw-r--r-- 857 bytes parent folder | download
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()