@@ -0,0 +1,1697 @@
+import unittest%0Aimport sys%0Asys.path.append('./')%0A%0Afrom l20n.parser import Parser, ParserError%0A%0Aclass L20nParserTestCase(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.parser = Parser()%0A%0A    def test_empty_entity(self):%0A        string = %22%3Cid%3E%22%0A        lol = self.parser.parse(string)%0A        self.assertEqual(len(lol.body), 1)%0A        self.assertEqual(lol.body%5B0%5D.id.name, %22id%22)%0A%0A    def test_string_value(self):%0A        string = %22%3Cid 'string'%3E%22%0A        lol = self.parser.parse(string)%0A        self.assertEqual(len(lol.body), 1)%0A        self.assertEqual(lol.body%5B0%5D.id.name, %22id%22)%0A        self.assertEqual(lol.body%5B0%5D.value.content, 'string')%0A%0A%0A        string = '%3Cid %22string%22%3E'%0A        lol = self.parser.parse(string)%0A        self.assertEqual(len(lol.body), 1)%0A        self.assertEqual(lol.body%5B0%5D.id.name, %22id%22)%0A        self.assertEqual(lol.body%5B0%5D.value.content, 'string')%0A%0A    def test_string_value_quotes(self):%0A        string = '%3Cid %22str%5C%5C%22ing%22%3E'%0A        lol = self.parser.parse(string)%0A        self.assertEqual(lol.body%5B0%5D.value.content, 'str%5C%5C%22ing')%0A%0A        string = %22%3Cid 'str%5C%5C'ing'%3E%22%0A        lol = self.parser.parse(string)%0A        self.assertEqual(lol.body%5B0%5D.value.content, %22str%5C%5C'ing%22)%0A%0A    def test_basic_errors(self):%0A        strings = %5B%0A            '%3C %22str%5C%5C%22ing%22%3E',%0A            %22%3C%3E%22,%0A            %22%3Cid%22,%0A            %22id%3E%22,%0A            '%3Cid %22value%3E',%0A            '%3Cid value%22%3E',%0A            %22%3Cid 'value%3E%22,%0A            %22%3Cid value'%22,%0A            %22%3Cid'value'%3E%22,%0A            '%3Cid%22value%22%3E',%0A            '%3C id %22value%22%3E'%0A        %5D%0A        for string in strings:%0A            self.assertRaises(ParserError, self.parser.parse, string)%0A%0A%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A%0A

add parser tests