Skip to content

Commit 97bfb90

Browse files
committed
Add test coverage for get_raw_token and auth_type assertions
1 parent 356392f commit 97bfb90

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_008_auth.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def test_get_token_struct(self):
8282
assert isinstance(token_struct, bytes)
8383
assert len(token_struct) > 4
8484

85+
def test_get_raw_token_default(self):
86+
raw_token = AADAuth.get_raw_token("default")
87+
assert isinstance(raw_token, str)
88+
assert raw_token == SAMPLE_TOKEN
89+
8590
def test_get_token_default(self):
8691
token_struct = AADAuth.get_token("default")
8792
assert isinstance(token_struct, bytes)
@@ -333,6 +338,7 @@ def test_process_connection_string_with_default_auth(self):
333338
assert attrs is not None
334339
assert 1256 in attrs
335340
assert isinstance(attrs[1256], bytes)
341+
assert auth_type == "default"
336342

337343
def test_process_connection_string_no_auth(self):
338344
conn_str = "Server=test;Database=testdb;UID=user;PWD=password"
@@ -343,6 +349,7 @@ def test_process_connection_string_no_auth(self):
343349
assert "UID=user" in result_str
344350
assert "PWD=password" in result_str
345351
assert attrs is None
352+
assert auth_type is None
346353

347354
def test_process_connection_string_interactive_non_windows(self, monkeypatch):
348355
monkeypatch.setattr(platform, "system", lambda: "Darwin")
@@ -354,6 +361,7 @@ def test_process_connection_string_interactive_non_windows(self, monkeypatch):
354361
assert attrs is not None
355362
assert 1256 in attrs
356363
assert isinstance(attrs[1256], bytes)
364+
assert auth_type == "interactive"
357365

358366

359367
def test_error_handling():

0 commit comments

Comments
 (0)