def test_negative_duplicate_name_variable(self): """Create Smart Variable with an existing name. :id: cc219111-1d2a-47ae-9b22-0b399f2d586d :steps: 1. Create a smart Variable with Valid name and default value. 2. Attempt to create a variable with same name from same/other class. :expectedresults: The variable with same name are not allowed to create from any class. :CaseImportance: Critical """ name = gen_string('alpha') make_smart_variable({ 'variable': name, 'puppet-class': self.puppet_class['name'] }) with self.assertRaises(CLIReturnCodeError): SmartVariable.create({ 'variable': name, 'puppet-class': self.puppet_class['name'] })
def test_negative_create(self): """Create Smart Variable with invalid name. :id: 3f71f39f-4178-42e7-be40-2a3538361466 :steps: Create a smart Variable with Invalid name. :expectedresults: The smart Variable is not created. """ name = invalid_values_list()[0] with self.assertRaises(CLIReturnCodeError): SmartVariable.create({'variable': name, 'puppet-class': self.puppet_class['name']})
def test_negative_create(self): """Create Smart Variable with invalid name. @id: 3f71f39f-4178-42e7-be40-2a3538361466 @steps: 1. Create a smart Variable with Invalid name. @assert: The smart Variable is not created. """ for name in invalid_values_list(): with self.subTest(name): with self.assertRaises(CLIReturnCodeError): SmartVariable.create({ 'variable': name, 'puppet-class': self.puppet_class['name'] })
def test_negative_create(self): """Create Smart Variable with invalid name. @id: 3f71f39f-4178-42e7-be40-2a3538361466 @steps: 1. Create a smart Variable with Invalid name. @assert: The smart Variable is not created. """ for name in invalid_values_list(): with self.subTest(name): with self.assertRaises(CLIReturnCodeError): SmartVariable.create({ 'variable': name, 'puppet-class': self.puppet['name'] })
def test_negative_validate_default_value_with_list(self): """Test variable is not created for unmatched validator type list. :id: dc2b6471-99d7-448b-b90a-9675baacbebe :steps: Attempt to create variable with default value that doesn't match values from validator list :expectedresults: Variable is not created for unmatched validator rule. :CaseImportance: High """ with self.assertRaises(CLIReturnCodeError): SmartVariable.create({ 'puppet-class': self.puppet_class['name'], 'default-value': gen_string('alphanumeric'), 'validator-type': 'list', 'validator-rule': '5, test', })
def test_negative_validate_default_value_with_list(self): """Test variable is not created for unmatched validator type list. @id: dc2b6471-99d7-448b-b90a-9675baacbebe @steps: 1. Attempt to create variable with default value that doesn't match values from validator list @assert: Variable is not created for unmatched validator rule. """ with self.assertRaises(CLIReturnCodeError): SmartVariable.create({ 'puppet-class': self.puppet_class['name'], 'default-value': gen_string('alphanumeric'), 'validator-type': 'list', 'validator-rule': '5, test', })
def test_negative_duplicate_name_variable(self): """Create Smart Variable with an existing name. @id: cc219111-1d2a-47ae-9b22-0b399f2d586d @steps: 1. Create a smart Variable with Valid name and default value. 2. Attempt to create a variable with same name from same/other class. @assert: The variable with same name are not allowed to create from any class. """ name = gen_string('alpha') make_smart_variable( {'variable': name, 'puppet-class': self.puppet_class['name']}) with self.assertRaises(CLIReturnCodeError): SmartVariable.create({ 'variable': name, 'puppet-class': self.puppet_class['name']})