Пример #1
0
    def test_complex_list(self):
        value = [1, 6.5, 'derp', [3, 4, 5], {1: 'wow', 'neat': 2}]

        expected = [
            '1', '6.5', 'derp', ['3', '4', '5'], {
                '1': 'wow',
                'neat': '2'
            }
        ]

        self.assertEqual(expected, util.inner_stringify(value))
Пример #2
0
    def test_complex_dict(self):
        value = {
            5: 7.5,
            'id': 1,
            'derp': 'herp',
            'list': [1, 2.3, 'hi'],
            'dict': {
                0: 'cool',
                'omg': 5
            }
        }

        expected = {
            '5': '7.5',
            'id': '1',
            'derp': 'herp',
            'list': ['1', '2.3', 'hi'],
            'dict': {
                '0': 'cool',
                'omg': '5'
            }
        }

        self.assertEqual(expected, util.inner_stringify(value))
Пример #3
0
    def test_simple_dict(self):
        value = {5: 7.5, 'id': 1, 'derp': 'herp'}
        expected = {'5': '7.5', 'id': '1', 'derp': 'herp'}

        self.assertEqual(expected, util.inner_stringify(value))
Пример #4
0
    def test_simple_list(self):
        value = [1, 6.5, 'derp']
        expected = ['1', '6.5', 'derp']

        self.assertEqual(expected, util.inner_stringify(value))
Пример #5
0
    def test_str(self):
        value = 'hi'
        expected = 'hi'

        self.assertEqual(expected, util.inner_stringify(value))
Пример #6
0
    def test_number(self):
        value = 5
        expected = '5'

        self.assertEqual(expected, util.inner_stringify(value))