Пример #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)