예제 #1
0
 def test_client_read_only(self):
     workflow_client = WorkflowStateClient(
         self.client, self.states["unit_relation"])
     with (yield workflow_client.lock()):
         yield self.assertFailure(
             workflow_client.set_state("up"),
             NotImplementedError)
예제 #2
0
    def test_client_readonly(self):
        with (yield self.workflow.lock()):
            yield self.workflow.fire_transition("install")
        workflow_client = WorkflowStateClient(
            self.client, self.states["unit"])

        self.assertEqual(
            (yield workflow_client.get_state()), "started")
        with (yield workflow_client.lock()):
            yield self.assertFailure(
                workflow_client.set_state("stopped"), NotImplementedError)
        self.assertEqual(
            (yield workflow_client.get_state()), "started")