Exemple #1
0
 def test_parsing_example_import(self):
     test_import = 'import com.wellaware.test; //this is sample text'
     result = GroovyImportParser.parse(test_import)
     self.assertListEqual(result.comment_list,
                          ['this', 'is', 'sample', 'text'])
     self.assertListEqual(result.import_list,
                          ['import com.wellaware.test;'])
     self.assertListEqual(result.import_strings, ['com.wellaware.test'])
Exemple #2
0
    def test_bad_parse(self):
        result = GroovyImportParser.parse(1)
        self.assertEqual(result, None)

        result = GroovyFunctionParser.parse(1)
        self.assertEqual(result, None)