Ejemplo n.º 1
0
 def _get_test_server_object():
     server_object = Object()
     server_object.name = 'test'
     server_object.directory = '/dir'
     server_object.acl = [TestApiShares._get_test_acl_object()]
     server_object.access = gateway_enum.Acl.WindowsNT
     server_object.clientSideCaching = gateway_enum.ClientSideCaching.Manual
     server_object.dirPermissions = 777
     server_object.comment = ''
     server_object.exportToAFP = False
     server_object.exportToFTP = False
     server_object.exportToNFS = False
     server_object.exportToPCAgent = False
     server_object.exportToRSync = False
     server_object.indexed = False
     server_object.trustedNFSClients = [
         TestApiShares._get_test_trusted_nfs_clients_object()
     ]
     return server_object
Ejemplo n.º 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_str(self):
     o = Object()
     o.name = "alice"
     self.assertEqual(base_convert.TestJSON._tojsonstr(o), '{"name": "alice"}')