Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
idimov-keeper committed Sep 11, 2024
1 parent 0298b1f commit f0c8a4a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
16 changes: 11 additions & 5 deletions sdk/python/core/keeper_secrets_manager_core/dto/dtos.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,17 @@ def __init__(self):
self.type = None


VALID_RECORD_FIELDS = ['login', 'password', 'url', 'fileRef', 'oneTimeCode', 'otp', 'name', 'birthDate', 'date',
'expirationDate', 'text', 'securityQuestion', 'multiline', 'email', 'cardRef', 'addressRef',
'pinCode', 'phone', 'secret', 'note', 'accountNumber', 'paymentCard', 'bankAccount', 'keyPair',
'host', 'address', 'licenseNumber', 'recordRef', 'schedule', 'directoryType', 'databaseType',
'pamHostname', 'pamResources', 'checkbox', 'passkey', 'script']
VALID_RECORD_FIELDS = [
'accountNumber', 'address', 'addressRef', 'appFiller', 'bankAccount',
'birthDate', 'cardRef', 'checkbox', 'databaseType', 'date',
'directoryType', 'dropdown', 'email', 'expirationDate', 'fileRef', 'host',
'isSSIDHidden', 'keyPair', 'licenseNumber', 'login', 'multiline', 'name',
'note', 'oneTimeCode', 'otp', 'pamHostname', 'pamRemoteBrowserSettings',
'pamResources', 'pamSettings', 'passkey', 'password', 'paymentCard',
'phone', 'pinCode', 'rbiUrl', 'recordRef', 'schedule', 'script', 'secret',
'securityQuestion', 'text', 'trafficEncryptionSeed', 'url',
'wifiEncryption'
]


class RecordField:
Expand Down
22 changes: 20 additions & 2 deletions sdk/python/helper/tests/v3/v3_field_type_all_fields_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,25 @@ def test_pam_resources(self):
ft.controllerUid = "OlLZ6JLjnyMOS3CiIPHBjw"
ft.folderUid = "so5ja6A46Zmr9J1QyCc06g"
ft.resourceRef = ["hUrGHrcM0PI3Y6Ch5wCrAQ"]
self._check_dict(ft, value={"controllerUid": "OlLZ6JLjnyMOS3CiIPHBjw", "folderUid": "so5ja6A46Zmr9J1QyCc06g", "resourceRef": ["hUrGHrcM0PI3Y6Ch5wCrAQ"]})
ft.allowedSettings = {
"connections": True,
"portForwards": True,
"rotation": True,
"sessionRecording": True,
"typescriptRecording": True
}
self._check_dict(ft, value={
"controllerUid": "OlLZ6JLjnyMOS3CiIPHBjw",
"folderUid": "so5ja6A46Zmr9J1QyCc06g",
"resourceRef": ["hUrGHrcM0PI3Y6Ch5wCrAQ"],
"allowedSettings": {
"connections": True,
"portForwards": True,
"rotation": True,
"sessionRecording": True,
"typescriptRecording": True
}
})

def test_checkbox(self):
ft = Checkbox()
Expand Down Expand Up @@ -383,7 +401,7 @@ def test_passkey(self):
"username": "user1",
"createdDate": 1625140800000})

def test_scrpt(self):
def test_script(self):
ft = Script()
ft.fileRef = "OlLZ6JLjnyMOS3CiIPHBjw"
ft.command = "/bin/zsh"
Expand Down

0 comments on commit f0c8a4a

Please sign in to comment.