]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
WIP
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 19 Aug 2021 10:09:19 +0000 (12:09 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 19 Aug 2021 10:09:19 +0000 (12:09 +0200)
src/Container/SALOME_CPythonHelper.cxx
src/SALOMESDS/TestSalomeSDS.py

index c0741d1f74fcf57a6b5f5bad82dd315be5fb446f..e536fe20525599641ec92bf5d6933164d5670502 100644 (file)
@@ -120,13 +120,13 @@ std::string SALOME_CPythonHelper::evalS(const std::string& pyCode) const
   return ret;
 }
 
+
 SALOME_CPythonHelper::~SALOME_CPythonHelper()
 {
   // _globals is borrowed ref -> do nothing
-  /*if(_locals)
-  {
-    auto refcount_locals = Py_REFCNT(_locals);
-  }*/
+
+  /*if(_locals){ auto refcount_locals = Py_REFCNT(_locals); }*/
+  
   Py_XDECREF(_locals);
   Py_XDECREF(_pickler);
 }
index 0a6cf90a0f3a9b245cc64bfaf89f2c204be9d3e8..2c4c27dc32ed905d1adc75c3803650c2886da490 100644 (file)
@@ -95,7 +95,7 @@ def func_test7(scopeName,cv,cv2,cv3,sharedNum):
   
 class SalomeSDSTest(unittest.TestCase):
   
-  def tessList1(self):
+  def testList1(self):
     scopeName = "Scope0"
     a=SalomeSDSClt.CreateRdExtGlobalVar([],"a",scopeName)
     self.assertEqual(a.local_copy(),[])
@@ -119,7 +119,7 @@ class SalomeSDSTest(unittest.TestCase):
     salome.dsm.removeDataScope(scopeName)
     pass
   
-  def tessDict1(self):
+  def testDict1(self):
     scopeName = "Scope0"
     a=SalomeSDSClt.CreateRdExtGlobalVar({},"a",scopeName)
     a["ab"]=4
@@ -145,7 +145,7 @@ class SalomeSDSTest(unittest.TestCase):
     salome.dsm.removeDataScope(scopeName)
     pass
 
-  def tessReadOnly1(self):
+  def testReadOnly1(self):
     scopeName = "Scope0"
     #
     a=SalomeSDSClt.CreateRdOnlyGlobalVar({"ab":4,"cd":[5,77]},"a",scopeName)
@@ -189,7 +189,7 @@ class SalomeSDSTest(unittest.TestCase):
     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")
@@ -214,7 +214,7 @@ class SalomeSDSTest(unittest.TestCase):
     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")
@@ -237,7 +237,7 @@ class SalomeSDSTest(unittest.TestCase):
     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")
@@ -262,7 +262,7 @@ class SalomeSDSTest(unittest.TestCase):
     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"
@@ -297,7 +297,7 @@ class SalomeSDSTest(unittest.TestCase):
     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"
@@ -346,7 +346,7 @@ class SalomeSDSTest(unittest.TestCase):
       dsm.removeDataScope(scopeName)
     pass
 
-  def tessTransaction7(self):
+  def testTransaction7(self):
     """Like testTransaction5 but after a recovery."""
     scopeName="Scope1"
     varName="a"
@@ -371,7 +371,7 @@ class SalomeSDSTest(unittest.TestCase):
     dsm.removeDataScope(scopeName)
     pass
 
-  def tessTransaction8(self):
+  def testTransaction8(self):
     """ EDF 16833 and EDF17719 """
     funcContent="""def comptchev(a,b):
     return "d" not in a
@@ -409,7 +409,7 @@ class SalomeSDSTest(unittest.TestCase):
     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
@@ -440,7 +440,7 @@ class SalomeSDSTest(unittest.TestCase):
     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.
     """
@@ -493,15 +493,11 @@ class SalomeSDSTest(unittest.TestCase):
     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()
+