Пример #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)
Пример #2
0
 def test_blob(self):
     self.assertEqual('b\'bytes\'', py_default('blob'))
Пример #3
0
 def test_string(self):
     self.assertEqual('\'string\'', py_default('string'))
Пример #4
0
 def test_map(self):
     self.assertEqual('{...}', py_default('map'))
Пример #5
0
 def test_list(self):
     self.assertEqual('[...]', py_default('list'))
Пример #6
0
 def test_structure(self):
     self.assertEqual('{...}', py_default('structure'))
Пример #7
0
 def test_long(self):
     self.assertEqual('123', py_default('long'))
Пример #8
0
 def test_timestamp(self):
     self.assertEqual('datetime(2015, 1, 1)', py_default('timestamp'))
Пример #9
0
 def test_integer(self):
     self.assertEqual('123', py_default('integer'))
Пример #10
0
 def test_string(self):
     self.assertEqual('\'string\'', py_default('string'))
Пример #11
0
 def test_blob(self):
     self.assertEqual('b\'bytes\'', py_default('blob'))
Пример #12
0
 def test_map(self):
     self.assertEqual('{...}', py_default('map'))
Пример #13
0
 def test_list(self):
     self.assertEqual('[...]', py_default('list'))
Пример #14
0
 def test_structure(self):
     self.assertEqual('{...}', py_default('structure'))
Пример #15
0
 def test_timestamp(self):
     self.assertEqual('datetime(2015, 1, 1)', py_default('timestamp'))
Пример #16
0
 def test_long(self):
     self.assertEqual('123', py_default('long'))
Пример #17
0
 def test_integer(self):
     self.assertEqual('123', py_default('integer'))
Пример #18
0
 def test_double(self):
     self.assertEqual('123.0', py_default('double'))
Пример #19
0
 def test_double(self):
     self.assertEqual('123.0', py_default('double'))
Пример #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)