UT: add a test for parsing username with special characters

This commit is contained in:
vakarisz 2022-02-23 10:13:08 +02:00
parent 8dedb7eac5
commit 3ff9bbe327
1 changed files with 16 additions and 0 deletions

View File

@ -30,6 +30,15 @@ cred_telem_usernames["data"] = [
{"identities": [{"username": fake_username, "credential_type": "USERNAME"}], "secrets": []}
]
fake_special_username = "$m0nk3y.user"
cred_telem_special_usernames = deepcopy(CREDENTIAL_TELEM_TEMPLATE)
cred_telem_special_usernames["data"] = [
{
"identities": [{"username": fake_special_username, "credential_type": "username"}],
"secrets": [],
}
]
fake_nt_hash = "c1c58f96cdf212b50837bc11a00be47c"
fake_lm_hash = "299BD128C1101FD6"
fake_password = "trytostealthis"
@ -65,6 +74,13 @@ def test_cred_username_parsing(fake_mongo):
assert fake_username in dpath.util.get(config, USER_LIST_PATH)
@pytest.mark.usefixtures("uses_database")
def test_cred_special_username_parsing(fake_mongo):
parse_credentials(cred_telem_special_usernames)
config = ConfigService.get_config(should_decrypt=True)
assert fake_special_username in dpath.util.get(config, USER_LIST_PATH)
@pytest.mark.usefixtures("uses_database")
def test_cred_telemetry_parsing(fake_mongo):
parse_credentials(cred_telem)