From 94d8a51c39ce09b6edbc9a6d4eaea97a4097a88d Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Thu, 5 Dec 2019 11:38:07 +0100 Subject: [PATCH] simple unit test for hbplus --- modules/bindings/tests/CMakeLists.txt | 1 + modules/bindings/tests/test_hbplus.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/bindings/tests/test_hbplus.py diff --git a/modules/bindings/tests/CMakeLists.txt b/modules/bindings/tests/CMakeLists.txt index 17a60fa55..d99953fe2 100644 --- a/modules/bindings/tests/CMakeLists.txt +++ b/modules/bindings/tests/CMakeLists.txt @@ -9,6 +9,7 @@ set(OST_BINDINGS_UNIT_TESTS test_tmtools.py test_ialign.py test_lga.py + test_hbplus.py ) ost_unittest(MODULE bindings diff --git a/modules/bindings/tests/test_hbplus.py b/modules/bindings/tests/test_hbplus.py new file mode 100644 index 000000000..87a32d282 --- /dev/null +++ b/modules/bindings/tests/test_hbplus.py @@ -0,0 +1,25 @@ +import unittest +from ost import * +from ost import settings +from ost.bindings import hbplus + +class TestHBPlusBinding(unittest.TestCase): + + def setUp(self): + self.protein = io.LoadEntity("testfiles/testprotein.pdb") + + def testHBondList(self): + hbond_list = hbplus.HBondList(self.protein) + self.assertEqual(len(hbond_list), 499) + + def testHBondScore(self): + self.assertEqual(hbplus.HBondScore(self.protein, self.protein), 1.0) + +if __name__ == "__main__": + try: + settings.Locate("hbplus") + except: + print("Could not find hbplus, could not test binding...") + sys.exit(0) + from ost import testutils + testutils.RunTests() -- GitLab