Example #1
0
    def document_shape_default(self, section, shape, history, include=None,
                               exclude=None, **kwargs):
        py_type = self._get_special_py_default(shape)
        if py_type is None:
            py_type = py_default(shape.type_name)

        if self._context.get('streaming_shape') == shape:
            py_type = 'StreamingBody()'
        section.write(py_type)
 def test_blob(self):
     self.assertEqual('b\'bytes\'', py_default('blob'))
 def test_string(self):
     self.assertEqual('\'string\'', py_default('string'))
 def test_map(self):
     self.assertEqual('{...}', py_default('map'))
 def test_list(self):
     self.assertEqual('[...]', py_default('list'))
 def test_structure(self):
     self.assertEqual('{...}', py_default('structure'))
 def test_long(self):
     self.assertEqual('123', py_default('long'))
Example #8
0
 def test_timestamp(self):
     self.assertEqual('datetime(2015, 1, 1)', py_default('timestamp'))
Example #9
0
 def test_integer(self):
     self.assertEqual('123', py_default('integer'))
Example #10
0
 def test_string(self):
     self.assertEqual('\'string\'', py_default('string'))
Example #11
0
 def test_blob(self):
     self.assertEqual('b\'bytes\'', py_default('blob'))
Example #12
0
 def test_map(self):
     self.assertEqual('{...}', py_default('map'))
Example #13
0
 def test_list(self):
     self.assertEqual('[...]', py_default('list'))
Example #14
0
 def test_structure(self):
     self.assertEqual('{...}', py_default('structure'))
 def test_timestamp(self):
     self.assertEqual('datetime(2015, 1, 1)', py_default('timestamp'))
Example #16
0
 def test_long(self):
     self.assertEqual('123', py_default('long'))
 def test_integer(self):
     self.assertEqual('123', py_default('integer'))
Example #18
0
 def test_double(self):
     self.assertEqual('123.0', py_default('double'))
 def test_double(self):
     self.assertEqual('123.0', py_default('double'))
Example #20
0
 def document_shape_default(self, section, shape, history, include=None,
                            exclude=None, **kwargs):
     py_type = py_default(shape.type_name)
     section.write(py_type)