示例#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
 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
 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
 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
 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
 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)