Пример #1
0
 def _get_test_server_object():
     server_object = Object()
     server_object._uuid = str(uuid.uuid4())  # pylint: disable=protected-access
     server_object.uid = '123'
     server_object.username = '******'
     server_object.fullName = 'Test Unit'
     server_object.email = '*****@*****.**'
     server_object.password = '******'
     return server_object
Пример #2
0
 def test_named_tuple(self):
     o = Object()
     o.name = "alice"
     o.email = "*****@*****.**"
     o.firstName = "Alice"
     o.lastName = "Wonderland"
     o.company = "Microsoft Corporation"
     o.showTutorial = True
     o.uid = 2156
     o.password = None
     user_object = '<obj>' \
         '<att id="name"><val>alice</val></att>' \
         '<att id="email"><val>[email protected]</val></att>' \
         '<att id="firstName"><val>Alice</val></att>' \
         '<att id="lastName"><val>Wonderland</val></att>' \
         '<att id="company"><val>Microsoft Corporation</val></att>' \
         '<att id="showTutorial"><val>true</val></att>' \
         '<att id="uid"><val>2156</val></att>' \
         '<att id="password" />' \
         '</obj>'
     self.assertEqual(base_convert.TestXML._toxmlstr(o), user_object)
 def test_int(self):
     o = Object()
     o.uid = 2156
     self.assertEqual(base_convert.TestJSON._tojsonstr(o), '{"uid": 2156}')