Exemple #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)
Exemple #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)
Exemple #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
Exemple #4
0
 def test_qeparser_card(self):
     # Card
     parser    = QEParser(configText = fixtures.textCards)
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertCards)
Exemple #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)
Exemple #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)
Exemple #7
0
 def test_qeparser_file(self):
     # Configuration file
     parser    = QEParser(filename = "ni.scf.in")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertFile)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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
Exemple #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)
Exemple #13
0
 def test_qeparser_card(self):
     # Card
     parser = QEParser(configText=fixtures.textCards)
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertCards)
Exemple #14
0
 def test_qeparser_file(self):
     # Configuration file
     parser = QEParser(filename="ni.scf.in")
     parser.parse()
     self.assertEqual(parser.toString(), fixtures.assertFile)
Exemple #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)
Exemple #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)