Skip to content

Commit 3484849

Browse files
committed
Add unit test
1 parent ab6e2b9 commit 3484849

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/unit/fixtures/test_iam.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from databricks.labs.pytester.fixtures.iam import make_acc_group, make_group, make_user, Group
8+
from databricks.labs.pytester.fixtures.iam import make_acc_group, make_group, make_user, make_run_as, Group
99
from databricks.labs.pytester.fixtures.unwrap import call_stateful, CallContext
1010

1111

@@ -16,6 +16,13 @@ def test_make_user_no_args() -> None:
1616
ctx['ws'].users.create.assert_called_once()
1717
ctx['ws'].users.delete.assert_called_once()
1818

19+
def test_make_run_as_no_args() -> None:
20+
ctx, run_as = call_stateful(make_run_as)
21+
assert ctx is not None
22+
assert run_as is not None
23+
ctx['acc'].service_principals.create.assert_called_once()
24+
ctx['acc'].service_principals.delete.assert_called_once()
25+
1926

2027
def _setup_groups_api(call_context: CallContext, *, client_fixture_name: str) -> CallContext:
2128
"""Minimum mocking of the specific client so that when a group is created it is also visible via the list() method.

0 commit comments

Comments
 (0)