Exemple #1
0
 def test_missing_required(self):
     instance = self.mod.Person()
     pbtool.fill(instance, {
         'name': 'Hullo',
         'email': '*****@*****.**',
         'phone': []
     })
     self.assertRaises(Exception, instance.SerializeToString)
Exemple #2
0
 def test(self):
     instance = self.mod.Person()
     pbtool.fill(instance, {
         'name': 'Hullo',
         'email': '*****@*****.**',
         'id': 999,
         'phone': []
     })
     instance.SerializeToString()
Exemple #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()
Exemple #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()
Exemple #5
0
 def test_missing_optional(self):
     instance = self.mod.Person()
     pbtool.fill(instance, {'name': 'Hullo', 'id': 999, 'phone': []})
     instance.SerializeToString()