def test_set_config(self): test_config = { 'configId': config_table.EXCLUSIONS, 'config': 'configurations', } config_table.put_item(Item=test_config) config_table.set_config(test_config['configId'], 'configuration2') config_from_dynamodb = config_table.get_config(test_config['configId']) assert config_from_dynamodb == 'configuration2'
def update_remediations(remediations): config_table.set_config(config_table.REMEDIATIONS, remediations)
def update_severity_weights(severity_weight_map): config_table.set_config(config_table.SEVERITYWEIGHTS, severity_weight_map)
def update_severity_colors(severity_colors): config_table.set_config(config_table.SEVERITYCOLORS, severity_colors)
def update_exclusion_types(exclusions): config_table.set_config(config_table.EXCLUSIONS, exclusions)
def update_version(version): config_table.set_config(config_table.VERSION, version)
def populate_severity(self): config_table.set_config( config_table.SEVERITYCOLORS, { 'critical': { 'background': '000001', 'text': 'FFFFFF' }, 'high': { 'background': 'FF0000', 'text': 'FFFFFF' }, 'medium': { 'background': 'FF8000', 'text': 'FFFFFF' }, 'low': { 'background': 'FFFF00', 'text': '000000' }, 'info': { 'background': '00F000', 'text': '000000' }, 'ok': { 'background': '00FF00', 'text': '000000' }, }) config_table.set_config(config_table.SEVERITYWEIGHTS, { 'critical': 10000, 'high': 1000, 'medium': 100, 'low': 10, 'info': 0, }) config_table.set_config(config_table.VERSION, 'a version goes here') config_table.set_config( config_table.EXCLUSIONS, { 'exclusionTypes': { 'exception': { 'displayname': 'Exception', 'states': { 'initial': { 'effective': False, 'displayName': 'Submitted', 'actionName': 'Submit exception' }, 'approved': { 'displayName': 'Approved', 'actionName': 'Approve' }, 'rejected': { 'displayName': 'Rejected', 'actionName': 'Reject' }, 'archived': { 'displayName': 'Archived', 'actionName': 'Archive' } }, 'formFields': { 'reason': { 'label': 'Reason', 'placeholder': 'Enter reason for not complying with this requirement', 'showInNcrView': True } }, 'defaultDurationInDays': 365, 'maxDurationInDays': 1095 } } })