Esempio n. 1
0
 def test_missing_required(self):
     instance = self.mod.Person()
     pbtool.fill(instance, {
         'name': 'Hullo',
         'email': '*****@*****.**',
         'phone': []
     })
     self.assertRaises(Exception, instance.SerializeToString)
Esempio n. 2
0
 def test(self):
     instance = self.mod.Person()
     pbtool.fill(instance, {
         'name': 'Hullo',
         'email': '*****@*****.**',
         'id': 999,
         'phone': []
     })
     instance.SerializeToString()
Esempio n. 3
0
 def test_repeated(self):
     instance = self.mod.Person()
     pbtool.fill(
         instance, {
             'name':
             'Hullo',
             'id':
             999,
             'phone': [{
                 'number': '1-800-stuff'
             }, {
                 'number': '1-800-moar-stuff'
             }]
         })
     instance.SerializeToString()
Esempio n. 4
0
 def test_enum(self):
     instance = self.mod.Person()
     pbtool.fill(
         instance, {
             'name':
             'Hullo',
             'id':
             999,
             'phone': [{
                 'number': '1-800-stuff',
                 'type': 'WORK'
             }, {
                 'number': '1-800-stuff',
                 'type': 'MOBILE'
             }]
         })
     instance.SerializeToString()
Esempio n. 5
0
 def test_missing_optional(self):
     instance = self.mod.Person()
     pbtool.fill(instance, {'name': 'Hullo', 'id': 999, 'phone': []})
     instance.SerializeToString()