コード例 #1
0
 def testGlu(self):
     try:
         data2pdb.main(["-c", GLU_INI])
         self.assertFalse(diff_lines(GLU_OUT, GOOD_GLU_OUT))
     finally:
         silent_remove(PDB_TPL_OUT)
         silent_remove(GLU_OUT)
コード例 #2
0
ファイル: test_data2pdb.py プロジェクト: team-mayes/md_utils
 def testNotIni(self):
     # gracefully fail if give the wrong file to the -c option
     test_input = ["-c", NOT_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue("WARNING:  File contains no section headers" in output)
コード例 #3
0
ファイル: test_data2pdb.py プロジェクト: team-mayes/md_utils
 def testGlu(self):
     try:
         data2pdb.main(["-c", GLU_INI])
         self.assertFalse(diff_lines(GLU_OUT, GOOD_GLU_OUT))
     finally:
         silent_remove(PDB_TPL_OUT)
         silent_remove(GLU_OUT)
コード例 #4
0
 def testNotIni(self):
     # gracefully fail if give the wrong file to the -c option
     test_input = ["-c", NOT_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertTrue(
             "WARNING:  File contains no section headers" in output)
コード例 #5
0
 def testHelp(self):
     test_input = ['-h']
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertFalse(output)
     with capture_stdout(main, test_input) as output:
         self.assertTrue("optional arguments" in output)
コード例 #6
0
ファイル: test_data2pdb.py プロジェクト: team-mayes/md_utils
 def testHelp(self):
     test_input = ['-h']
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     with capture_stderr(main, test_input) as output:
         self.assertFalse(output)
     with capture_stdout(main, test_input) as output:
         self.assertTrue("optional arguments" in output)
コード例 #7
0
 def testDefIni(self):
     test_input = ["-c", DEF_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     try:
         main(test_input)
         self.assertFalse(diff_lines(PDB_OUT, GOOD_PDB_OUT))
     finally:
         silent_remove(PDB_TPL_OUT)
         silent_remove(PDB_OUT)
コード例 #8
0
ファイル: test_data2pdb.py プロジェクト: team-mayes/md_utils
 def testDefIni(self):
     test_input = ["-c", DEF_INI]
     if logger.isEnabledFor(logging.DEBUG):
         main(test_input)
     try:
         main(test_input)
         self.assertFalse(diff_lines(PDB_OUT, GOOD_PDB_OUT))
     finally:
         silent_remove(PDB_TPL_OUT)
         silent_remove(PDB_OUT)
コード例 #9
0
 def testGluDict(self):
     try:
         data2pdb.main(["-c", GLU_DICT_INI])
         self.assertFalse(diff_lines(GLU_OUT, GOOD_GLU_OUT))
         with open(DEF_DICT_OUT, 'r') as d_file:
             dict_test = json.load(d_file)
         with open(GOOD_DICT, 'r') as d_file:
             dict_good = json.load(d_file)
         self.assertEqual(dict_test, dict_good)
     finally:
         silent_remove(PDB_TPL_OUT)
         silent_remove(GLU_OUT)
         silent_remove(DEF_DICT_OUT)
コード例 #10
0
ファイル: test_data2pdb.py プロジェクト: team-mayes/md_utils
 def testGluDict(self):
     try:
         data2pdb.main(["-c", GLU_DICT_INI])
         self.assertFalse(diff_lines(GLU_OUT, GOOD_GLU_OUT))
         with open(DEF_DICT_OUT, 'r') as d_file:
             dict_test = json.load(d_file)
         with open(GOOD_DICT, 'r') as d_file:
             dict_good = json.load(d_file)
         self.assertEqual(dict_test, dict_good)
     finally:
         silent_remove(PDB_TPL_OUT)
         silent_remove(GLU_OUT)
         silent_remove(DEF_DICT_OUT)