Skip to content

Topotato: Regex Json Compare Directive#134

Open
eznix86 wants to merge 3 commits intotopotato-basefrom
topotato-json-compare-regex
Open

Topotato: Regex Json Compare Directive#134
eznix86 wants to merge 3 commits intotopotato-basefrom
topotato-json-compare-regex

Conversation

@eznix86
Copy link

@eznix86 eznix86 commented Sep 14, 2023

Usage:

compare = {
   "item": JsonCompareRegex(r"\s+"),
   "item1": JsonCompareRegex(r"\d+"),
   "item2": JsonCompareRegex("[A-Z]+"),
   "item3": JsonCompareRegex(r"^%?FRRouting/")
}

Example of errors:

E       topotato.exceptions.TopotatoCLICompareFail: json["item"] dict value is different (
E       1 vs regex '\\s+')
E       topotato.exceptions.TopotatoCLICompareFail: json["item1"] dict value is different (
E       abcd vs regex '\\d+')

Signed-off-by: Bruno Bernard <contact.brunobernard@gmail.com>
…to import

Signed-off-by: Bruno Bernard <contact.brunobernard@gmail.com>
…ng JSONCompareRegex

Signed-off-by: Bruno Bernard <contact.brunobernard@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants