class SalomeSDSTest(unittest.TestCase):
- def tessList1(self):
+ def testList1(self):
scopeName = "Scope0"
a=SalomeSDSClt.CreateRdExtGlobalVar([],"a",scopeName)
self.assertEqual(a.local_copy(),[])
salome.dsm.removeDataScope(scopeName)
pass
- def tessDict1(self):
+ def testDict1(self):
scopeName = "Scope0"
a=SalomeSDSClt.CreateRdExtGlobalVar({},"a",scopeName)
a["ab"]=4
salome.dsm.removeDataScope(scopeName)
pass
- def tessReadOnly1(self):
+ def testReadOnly1(self):
scopeName = "Scope0"
#
a=SalomeSDSClt.CreateRdOnlyGlobalVar({"ab":4,"cd":[5,77]},"a",scopeName)
self.assertEqual(asyncResult.get(),nbProc*[0]) # <- the big test is here !
dsm.removeDataScope(scopeName)
- def tessTransaction2(self):
+ def testTransaction2(self):
scopeName="Scope1"
varName="a"
dsm=salome.naming_service.Resolve("/DataServerManager")
self.assertEqual(str2Obj(dss.waitForMonoThrRev(wk)),[7,8,9,10])
dsm.removeDataScope(scopeName)
- def tessTransaction3(self):
+ def testTransaction3(self):
scopeName="Scope1"
varName="a"
dsm=salome.naming_service.Resolve("/DataServerManager")
self.assertEqual(str2Obj(dss.fetchSerializedContent(varName)),{'cd':[7,8,9,10]})
dsm.removeDataScope(scopeName)
- def tessTransaction4(self):
+ def testTransaction4(self):
scopeName="Scope1"
varName="a"
dsm=salome.naming_service.Resolve("/DataServerManager")
self.assertEqual(str2Obj(dss.fetchSerializedContent(varName)),{'ab':[4,5,6]})
dsm.removeDataScope(scopeName)
- def tessTransaction5(self):
+ def testTransaction5(self):
""" Like testTransaction2 but without transactions. """
scopeName="Scope1"
varName="a"
self.assertEqual(set(keys),set(['ab','cd']))
dsm.removeDataScope(scopeName)
- def tessTransaction6(self):
+ def testTransaction6(self):
""" Test to test RdWr global vars with transaction"""
scopeName="Scope1"
varName="a"
dsm.removeDataScope(scopeName)
pass
- def tessTransaction7(self):
+ def testTransaction7(self):
"""Like testTransaction5 but after a recovery."""
scopeName="Scope1"
varName="a"
dsm.removeDataScope(scopeName)
pass
- def tessTransaction8(self):
+ def testTransaction8(self):
""" EDF 16833 and EDF17719 """
funcContent="""def comptchev(a,b):
return "d" not in a
dsm.removeDataScope(scopeName)
pass
- def tessTransaction9(self):
+ def testTransaction9(self):
""" EDF 16833 and EDF17719 : use case 2. Trying to createRdExt during add key session"""
funcContent="""def comptchev(a,b):
return a==b
pass
- def tessLockToDump(self):
+ def testLockToDump(self):
""" Test to check that holdRequests method. This method wait for clean server status and hold it until activeRequests is called.
Warning this method expects a not overloaded machine to be run because test is based on ellapse time.
"""
p.join()
dsm.removeDataScope(scopeName)
pass
-
- def setUp(self):
- salome.salome_init_without_session()
- pass
pass
if __name__=="__main__":
- unittest.main()
- salome.salome_close()
-
+ with salome.SessionContextManager():
+ unittest.main()
+