Skip to content

Supports a regex pattern in the contract and validate the data against it #8

@KumarManoj-S

Description

@KumarManoj-S

Regex pattern should be supported in the contract as follows,

from pycontract import Contract, Types

my_contract = {
    'label': '^LABEL_[A-Z]*$',
    'name': Types.STRING
}
contract = Contract(my_contract)

assert contract.verify({'name': 'Product 1': 'label': 'LABEL_CREATED'}) is True # should result in true

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions