예제 #1
0
 def test_qeparser_comments(self):
     # Filters out comments
     parser          = QEParser(filename = "ph.mgb2.in", type="ph")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertMgB2)
예제 #2
0
 def test_qeparser_header(self):
     # Header for PH configuration files is mandatory
     parser          = QEParser(configText = fixtures.textHeader, type="ph")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertHeader)
예제 #3
0
 def test_qeparser_type(self):
     # Type of configuration file recognizes specific namelists and card only!
     parser          = QEParser(configText = fixtures.textHeader, type="pw")
     parser.parse()
     self.assertEqual(parser.toString(), '') # namelist 'INPUTPH' is not recognized
예제 #4
0
 def test_qeparser_card(self):
     # Card
     parser    = QEParser(configText = fixtures.textCards)
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertCards)
예제 #5
0
 def test_qeparser_comma(self):
     # Parameters on the same line separated by comma - does not parse as it
     # should (intentionally)
     parser          = QEParser(configText = fixtures.textComma, type="matdyn")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertComma)
예제 #6
0
 def test_qeparser_dynmat(self):
     # Slash and name of namelist on the same line with parameters
     parser    = QEParser(configText = fixtures.textDynmat, type="dynmat")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertDynmat)
예제 #7
0
 def test_qeparser_file(self):
     # Configuration file
     parser    = QEParser(filename = "ni.scf.in")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertFile)
예제 #8
0
 def test_qeparser_comments(self):
     # Filters out comments
     parser = QEParser(filename="ph.mgb2.in", type="ph")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertMgB2)
예제 #9
0
 def test_qeparser_matdyn(self):
     # Attachment after card
     parser    = QEParser(configText = fixtures.textMatdyn, type="matdyn")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertMatdyn)
예제 #10
0
 def test_qeparser_header(self):
     # Header for PH configuration files is mandatory
     parser = QEParser(configText=fixtures.textHeader, type="ph")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertHeader)
예제 #11
0
 def test_qeparser_type(self):
     # Type of configuration file recognizes specific namelists and card only!
     parser = QEParser(configText=fixtures.textHeader, type="pw")
     parser.parse()
     self.assertEqual(parser.toString(),
                      '')  # namelist 'INPUTPH' is not recognized
예제 #12
0
 def test_qeparser_comma(self):
     # Parameters on the same line separated by comma - does not parse as it
     # should (intentionally)
     parser = QEParser(configText=fixtures.textComma, type="matdyn")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertComma)
예제 #13
0
 def test_qeparser_card(self):
     # Card
     parser = QEParser(configText=fixtures.textCards)
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertCards)
예제 #14
0
 def test_qeparser_file(self):
     # Configuration file
     parser = QEParser(filename="ni.scf.in")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertFile)
예제 #15
0
 def test_qeparser_dynmat(self):
     # Slash and name of namelist on the same line with parameters
     parser = QEParser(configText=fixtures.textDynmat, type="dynmat")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertDynmat)
예제 #16
0
 def test_qeparser_matdyn(self):
     # Attachment after card
     parser = QEParser(configText=fixtures.textMatdyn, type="matdyn")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertMatdyn)