Пример #1
0
    def test_json_encode_file(self):
        file = StringIO()

        self.assertEqual(
            json_encode(file),
            'In memory file: ',
        )
Пример #2
0
    def test_json_encode_datetime(self):
        now = datetime.utcnow()

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