23 |
23 |
24 from six import PY2 |
24 from six import PY2 |
25 |
25 |
26 from mock import patch |
26 from mock import patch |
27 |
27 |
28 from cubicweb.cwconfig import CubicWebConfiguration |
|
29 from cubicweb.cwctl import ListCommand |
28 from cubicweb.cwctl import ListCommand |
30 from cubicweb.devtools.testlib import CubicWebTC |
29 from cubicweb.devtools.testlib import CubicWebTC |
31 from cubicweb.server.migractions import ServerMigrationHelper |
30 from cubicweb.server.migractions import ServerMigrationHelper |
32 |
31 |
33 import unittest_cwconfig |
32 import unittest_cwconfig |
67 with self.admin_access.repo_cnx() as cnx: |
66 with self.admin_access.repo_cnx() as cnx: |
68 mih = ServerMigrationHelper(None, repo=repo, cnx=cnx, |
67 mih = ServerMigrationHelper(None, repo=repo, cnx=cnx, |
69 interactive=False, |
68 interactive=False, |
70 # hack so it don't try to load fs schema |
69 # hack so it don't try to load fs schema |
71 schema=1) |
70 schema=1) |
72 scripts = {'script1.py': list(), |
71 scripts = { |
73 'script2.py': ['-v'], |
72 'script1.py': list(), |
74 'script3.py': ['-vd', '-f', 'FILE.TXT'], |
73 'script2.py': ['-v'], |
75 } |
74 'script3.py': ['-vd', '-f', 'FILE.TXT'], |
|
75 } |
76 mih.cmd_process_script(join(self.datadir, 'scripts', 'script1.py'), |
76 mih.cmd_process_script(join(self.datadir, 'scripts', 'script1.py'), |
77 funcname=None) |
77 funcname=None) |
78 for script, args in scripts.items(): |
78 for script, args in scripts.items(): |
79 scriptname = os.path.join(self.datadir, 'scripts', script) |
79 scriptname = os.path.join(self.datadir, 'scripts', script) |
80 self.assertTrue(os.path.exists(scriptname)) |
80 self.assertTrue(os.path.exists(scriptname)) |