Skip to content

Commit 28d6cc8

Browse files
committed
Add generated code test
1 parent f8a3ceb commit 28d6cc8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_generated_code.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ def test_get_auth_token_without_env(model_data_with_cleanup):
2929
)
3030

3131

32+
def test_set_auth_token(model_data_with_cleanup):
33+
generate_data(test_data_path, test_result_path)
34+
35+
_locals = locals()
36+
program = """from .test_result import APIConfig
37+
assert APIConfig.get_access_token() is None
38+
APIConfig.set_access_token('foo_bar')
39+
assert APIConfig.get_access_token() == 'foo_bar'
40+
"""
41+
exec(
42+
program,
43+
globals(),
44+
_locals,
45+
)
46+
47+
3248
@pytest.mark.parametrize(
3349
"library, use_orjson",
3450
[

0 commit comments

Comments
 (0)