Ejemplo n.º 1
0
    def test_json_encode_file(self):
        file = StringIO()

        self.assertEqual(
            json_encode(file),
            'In memory file: ',
        )
Ejemplo n.º 2
0
    def test_json_encode_datetime(self):
        now = datetime.utcnow()

        self.assertEqual(
            json_encode(now),
            now.isoformat(),
        )
Ejemplo n.º 3
0
 def test_json_encode_set(self):
     assert json_encode({1, 2, 3}) == [1, 2, 3]
Ejemplo n.º 4
0
 def test_json_encode_file(self):
     file = StringIO()
     assert json_encode(file) == 'In memory file: '
Ejemplo n.º 5
0
 def test_json_encode_datetime(self):
     now = datetime.utcnow()
     assert json_encode(now) == now.isoformat()
Ejemplo n.º 6
0
 def test_json_encode_function(self):
     assert json_encode(
         get_operation_and_args) == 'Function: get_operation_and_args'
Ejemplo n.º 7
0
 def test_json_encode_set(self):
     self.assertEqual(
         json_encode({1, 2, 3}),
         [1, 2, 3],
     )
Ejemplo n.º 8
0
 def test_json_encode_function(self):
     self.assertEqual(
         json_encode(setup_arguments),
         'setup_arguments',
     )
Ejemplo n.º 9
0
 def test_json_encode_function(self):
     self.assertEqual(
         json_encode(get_operation_and_args),
         'get_operation_and_args',
     )