Esempio n. 1
0
    def test_json_codec_raw(self):
        structured = {
            u'Test': [1, None, u'str', {u'some': u'obj'}]
        }
        raw = json.dumps(structured)

        out = json_codec(raw, parameterized=False)
        self.assertEqual(structured, out)
Esempio n. 2
0
    def test_json_codec_raw(self):
        structured = {
            u'Test': [1, None, u'str', {u'some': u'obj'}]
        }
        raw = json.dumps(structured)

        out = json_codec(raw, parameterized=False)
        self.assertEqual(structured, out)
Esempio n. 3
0
    def test_json_codec_parameterized(self):
        processed = {
            u'Test': Join(u'',
                          [u'Test ', {
                              u'Ref': u'Interpolation'
                          }, u' Here'])
        }
        structured = {u'Test': u'Test {{Interpolation}} Here'}
        raw = json.dumps(structured)

        out = json_codec(raw, parameterized=True)
        self.assertTemplateEqual(processed, out)
Esempio n. 4
0
    def test_json_codec_parameterized(self):
        processed = {
            u'Test': Join(u'', [u'Test ', {u'Ref': u'Interpolation'},
                                u' Here'])
        }
        structured = {
            u'Test': u'Test {{Interpolation}} Here'
        }
        raw = json.dumps(structured)

        out = json_codec(raw, parameterized=True)
        self.assertTemplateEqual(processed, out)