def test_its_value_condition_match_the_search_regex_regex_resource_list( self): step = MockedStep() step.context.stash = MockedTerraformPropertyList() self.assertIsNone( its_value_condition_match_the_search_regex_regex( step, 'condition', 'some_regex'))
def test_its_property_contains_key_property_is_property_list(self): step = MockedStep() step.context.stash = MockedTerraformPropertyList() its_property_contains_key(step=step, property='something', key="key", resourcelist=MockedTerraformResourceList) self.assertEqual(step.state, 'skipped')
def test_it_must_contain_something_property_can_not_be_found(self, *args): step = MockedStep() step.context.stash = MockedTerraformPropertyList() step.sentence = 'Then it must contain' with self.assertRaises(AssertionError) as err: it_condition_contain_something(step, 'non_existent_property_value', MockedTerraformPropertyList) self.assertEqual(str(err.exception), 'non_existent_property_value property in test_name can not be found in ' 'test_resource_name (test_resource_type). It is set to test_value instead')
def test_its_value_must_not_match_the_search_regex_regex_failure(self): step = MockedStep() step.context.stash = MockedTerraformPropertyList() with self.assertRaises(AssertionError): its_value_condition_match_the_search_regex_regex( step, 'must not', 'non_match_regex')
def test_its_value_must_not_match_the_search_regex_regex_success(self): step = MockedStep() step.context.stash = MockedTerraformPropertyList() self.assertIsNone( its_value_condition_match_the_search_regex_regex( step, 'must not', '^[tesvalu_\s]+$'))