[test] Use RepoAccess.shell() in unittest_predicates
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 07 Apr 2014 14:28:47 +0200
changeset 9668 501f14e095d1
parent 9667 4714d4afd4ea
child 9669 283503f58400
[test] Use RepoAccess.shell() in unittest_predicates
test/unittest_predicates.py
--- a/test/unittest_predicates.py	Mon Apr 07 12:03:06 2014 +0200
+++ b/test/unittest_predicates.py	Mon Apr 07 14:28:47 2014 +0200
@@ -75,12 +75,13 @@
         super(WorkflowSelectorTC, self).tearDown()
 
     def setup_database(self):
-        wf = self.shell().add_workflow("wf_test", 'StateFull', default=True)
-        created   = wf.add_state('created', initial=True)
-        validated = wf.add_state('validated')
-        abandoned = wf.add_state('abandoned')
-        wf.add_transition('validate', created, validated, ('managers',))
-        wf.add_transition('forsake', (created, validated,), abandoned, ('managers',))
+        with self.admin_access.shell() as shell:
+            wf = shell.add_workflow("wf_test", 'StateFull', default=True)
+            created   = wf.add_state('created', initial=True)
+            validated = wf.add_state('validated')
+            abandoned = wf.add_state('abandoned')
+            wf.add_transition('validate', created, validated, ('managers',))
+            wf.add_transition('forsake', (created, validated,), abandoned, ('managers',))
 
     @contextmanager
     def statefull_stuff(self):