Exemple #1
0
    def test_write_parse(self):
        true_texts = core.getTestTexts()
        cursor = self.db.cursor()

        ios6.IOS6().write_cursor(true_texts, cursor)
        parsed_texts = ios6.IOS6().parse_cursor(cursor)

        for i in range(len(true_texts)):
            self.assertTextsEqual(true_texts[i], parsed_texts[i])
Exemple #2
0
    def test_write_parse(self):
        true_texts = core.getTestTexts()
        cursor = self.db.cursor()

        android.Android().write_cursor(true_texts, cursor)
        parsed_texts = android.Android().parse_cursor(cursor)

        for i in range(len(true_texts)):
            self.assertEqual(true_texts[i], parsed_texts[i])
Exemple #3
0
    def test_write_parse(self):
        true_texts = core.getTestTexts()

        strtxts = jsoner.JSONer().toJson(true_texts)

        decoded_objs = jsoner.JSONer().fromJson(strtxts)

        self.assertEqual(decoded_objs, true_texts)

        for i in range(len(true_texts)):
            self.assertEqual(true_texts[i], decoded_objs[i])
    def test_write_parse(self):
        true_texts = core.getTestTexts()

        file = StringIO.StringIO()
        jsoner.JSONer().write(true_texts, file)
        file.seek(0)
        json_str = file.read().decode('utf-8')

        file.seek(0)
        decoded_objs = jsoner.JSONer().parse(file)
        self.assertEqual(decoded_objs, true_texts)

        for i in range(len(true_texts)):
            self.assertEqual(true_texts[i], decoded_objs[i])