Beispiel #1
0
class L20nParserTestCase(with_metaclass(TestMeta, unittest.TestCase)):
    def setUp(self):
        self.parser = FTLParser()
        self.maxDiff = None

    def process(self, ftl):
        ftlPath = os.path.join(fixtures, ftl + '.ftl')
        jsonPath = os.path.join(fixtures, ftl + '.ast.json')
        source = read_file(ftlPath)
        jsonSource = read_file(jsonPath)
        [ast, errors] = self.parser.parseResource(source)
        refAST = json.loads(jsonSource)
        self.assertEqual(ast, refAST, 'Error in fixture: ' + ftl)
Beispiel #2
0
class L20nParserTestCase(with_metaclass(TestMeta, unittest.TestCase)):

    def setUp(self):
        self.parser = FTLParser()
        self.maxDiff = None

    def process(self, ftl):
        ftlPath = os.path.join(fixtures, ftl + '.ftl')
        jsonPath = os.path.join(fixtures, ftl + '.ast.json')
        source = read_file(ftlPath)
        jsonSource = read_file(jsonPath)
        [ast, errors] = self.parser.parseResource(source)
        refAST = json.loads(jsonSource)
        self.assertEqual(ast, refAST, 'Error in fixture: ' + ftl)