def test_deployable_simple(): was_run = [] def f(): was_run.append(1) decorator = troops.deployable() g = decorator(f) assert g is f eq(was_run, [1])
def test_deployable_roles_no(): was_run = [] def f(): was_run.append(1) decorator = troops.deployable(roles=['foo', 'bar']) g = decorator(f) assert g is f eq(was_run, [])
def test_deployable_roles_yes(): was_run = [] def f(): was_run.append(1) troops.roles.add('foo') decorator = troops.deployable(roles=['foo', 'bar']) g = decorator(f) assert g is f eq(was_run, [1])