Salome HOME
fix runner.cfg in command/prepare.py
[tools/sat.git] / test / config / option_copy.py
index cd80b8773f0c5c57b127d048ca4d8783798ac084..d671383d85cd4dbd2e463911ab5dda5f77f8ecff 100644 (file)
 import unittest
 import os
 import sys
-import shutil
 
 # get execution path
 testdir = os.path.dirname(os.path.realpath(__file__))
-sys.path.append(os.path.join(testdir, '..', '..', 'src'))
-sys.path.append(os.path.join(testdir, '..', '..', 'test', '_testTools'))
+sys.path.append(os.path.join(testdir, '..', '..'))
+sys.path.append(os.path.join(testdir, '..', '_testTools'))
 
-from salomeTools import salomeTools
+from salomeTools import Sat
 import HTMLTestRunner
 
 class TestConfig(unittest.TestCase):
-    '''pyunit class : each method execute one test.
+    '''sat config -c
     '''
     
     def test_option_copy(self):
-        '''Test the copy of a pyconf"
+        '''Test the copy of a pyconf
         '''
         res = "KO"
         appli_to_copy = "appli-test"
+
+        expected_file = os.path.expanduser(os.path.join('~','.salomeTools', 'Applications', 'LOCAL_' + appli_to_copy + '.pyconf'))
+        if os.path.exists(expected_file):
+            os.remove(expected_file)
                
         # The command to test
-        sat = salomeTools('')
+        sat = Sat('')
         sat.config('appli-test -c')
 
-        expected_file = os.path.expanduser(os.path.join('~','.salomeTools', 'Application', 'LOCAL_' + appli_to_copy + '.pyconf'))
 
         if os.path.exists(expected_file):
             res = "OK"