コード例 #1
0
    def setUp(self):
        self.string_data = 'sdfgsdfgsdfgsdfg'
        self.string_response = randomizer(self.string_data)

        self.integer_data = 1234567890
        self.integer_response = randomizer(self.integer_data)

        self.boolean_data = False
        self.boolean_response = randomizer(self.boolean_data)
コード例 #2
0
    def setUp(self):
        self.string_data = 'sdfgsdfgsdfgsdfg'
        self.string_response = randomizer(self.string_data)

        self.integer_data = 1234567890
        self.integer_response = randomizer(self.integer_data)

        self.boolean_data = False
        self.boolean_response = randomizer(self.boolean_data)
コード例 #3
0
 def test_sequence_response(self):
     """ Response (sequence) should have the same length and structure as input
     """
     payload = [1, 'a', ['a', 'b', [{'a': 'b'}, 'a']], False]
     response = randomizer(payload)
     self.assertEqual(len(payload), len(response))
     self.assertEqual(len(payload[2]), len(response[2]))
     self.assertEqual(len(payload[2][2]), len(response[2][2]))
コード例 #4
0
 def test_sequence_response(self):
     """ Response (sequence) should have the same length and structure as input
     """
     payload = [1, 'a', ['a', 'b', [{'a': 'b'}, 'a']], False]
     response = randomizer(payload)
     self.assertEqual(len(payload), len(response))
     self.assertEqual(len(payload[2]), len(response[2]))
     self.assertEqual(len(payload[2][2]), len(response[2][2]))
コード例 #5
0
 def test_dictionary_response(self):
     """ Response (dictionary) should have the same length and structure as input
         TODO: on older python versions key ordering could cause problems -
         that's why they must be reordered
     """
     payload = {
         'array': [1, 'a', ['a', 'b', [{'a': 'b'}, 'a']], False],
         'boolean': False,
         'sub_dict': {
             'key1': 'value1',
             'sub_sub_dict': {
                 'key1': 'value1'
             }
         }
     }
     response = randomizer(payload)
     self.assertEqual(len(payload), len(response))
コード例 #6
0
 def test_dictionary_response(self):
     """ Response (dictionary) should have the same length and structure as input
         TODO: on older python versions key ordering could cause problems -
         that's why they must be reordered
     """
     payload = {
         'array': [1, 'a', ['a', 'b', [{
             'a': 'b'
         }, 'a']], False],
         'boolean': False,
         'sub_dict': {
             'key1': 'value1',
             'sub_sub_dict': {
                 'key1': 'value1'
             }
         }
     }
     response = randomizer(payload)
     self.assertEqual(len(payload), len(response))