Esempio n. 1
0
    def test_core_types(self):
        values = [
            42, 'abc', b'abc', 100.0, True, False, 3j, None, [1, 2, 3],
            (1, 2, 3), {
                2: 3
            }
        ]

        for value in values:
            self.assertEqual(_decode(_encode(value)), value)
Esempio n. 2
0
 def test_other_types(self):
     try:
         import numpy
         self.assertTrue(_decode(_encode(numpy.ndarray(42))).all())
     except:
         return
 def test_other_types(self):
     try:
         import numpy
         self.assertTrue(_decode(_encode(numpy.ndarray(42))).all())
     except:
         return
    def test_core_types(self):
        values = [42, 'abc', b'abc', 100.0, True, False, 3j, None, [1,2,3], (1,2,3), {2:3}]

        for value in values:
            self.assertEqual(_decode(_encode(value)), value)