1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
From c8125e93bfb0963876992cb50c2442220c0ec300 Mon Sep 17 00:00:00 2001
From: jcfp <jcfp@debian.org>
Date: Mon, 20 Feb 2023 16:29:34 +0100
Subject: [PATCH] convert tests to tavern 2.0.0+
---
tests/data/tavern/api_get_files_format.yaml | 2 +-
tests/data/tavern/api_history_empty.yaml | 2 +-
tests/data/tavern/api_history_format.yaml | 2 +-
tests/data/tavern/api_queue_empty.yaml | 2 +-
tests/data/tavern/api_queue_format.yaml | 2 +-
tests/data/tavern/api_server_stats.yaml | 2 +-
tests/data/tavern/api_version.yaml | 4 ++--
tests/requirements.txt | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tests/data/tavern/api_get_files_format.yaml b/tests/data/tavern/api_get_files_format.yaml
index e46823085b..9315fc27f8 100755
--- a/tests/data/tavern/api_get_files_format.yaml
+++ b/tests/data/tavern/api_get_files_format.yaml
@@ -56,7 +56,7 @@ stages:
pragma: "no-cache"
access-control-allow-origin: "*"
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
# Verify response parameters with a regex using positive
# looksaheads, so parameters match regardless of their order
diff --git a/tests/data/tavern/api_history_empty.yaml b/tests/data/tavern/api_history_empty.yaml
index 0d15faabd5..22fa4e4511 100755
--- a/tests/data/tavern/api_history_empty.yaml
+++ b/tests/data/tavern/api_history_empty.yaml
@@ -54,7 +54,7 @@ stages:
access-control-allow-origin: "*"
content-length: !re_match "[0-9]+"
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
# Verify response with a regex using positive looksaheads so
# parameters match regardless of their order of appearance
diff --git a/tests/data/tavern/api_history_format.yaml b/tests/data/tavern/api_history_format.yaml
index 99c64098e1..45de020706 100755
--- a/tests/data/tavern/api_history_format.yaml
+++ b/tests/data/tavern/api_history_format.yaml
@@ -87,7 +87,7 @@ stages:
access-control-allow-origin: "*"
content-length: !re_match "[0-9]+"
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
# Verify response parameters with a regex using positive looksaheads,
# so parameters match regardless of their order of appearance. Note
diff --git a/tests/data/tavern/api_queue_empty.yaml b/tests/data/tavern/api_queue_empty.yaml
index d80d026e0e..5a3f45e2ea 100755
--- a/tests/data/tavern/api_queue_empty.yaml
+++ b/tests/data/tavern/api_queue_empty.yaml
@@ -78,7 +78,7 @@ stages:
access-control-allow-origin: "*"
content-length: !re_match "[0-9]+"
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
# Verify only a bunch of key response parameters with a regex using
# positive looksaheads, so parameters match regardless of their order
diff --git a/tests/data/tavern/api_queue_format.yaml b/tests/data/tavern/api_queue_format.yaml
index 8411f4a272..fcbe708785 100755
--- a/tests/data/tavern/api_queue_format.yaml
+++ b/tests/data/tavern/api_queue_format.yaml
@@ -98,7 +98,7 @@ stages:
access-control-allow-origin: "*"
content-length: !re_match "[0-9]+"
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
# Verify only a bunch of key response parameters with a regex using
# positive looksaheads, so parameters match regardless of their order
diff --git a/tests/data/tavern/api_server_stats.yaml b/tests/data/tavern/api_server_stats.yaml
index b42a1f2a38..a94a3b7823 100755
--- a/tests/data/tavern/api_server_stats.yaml
+++ b/tests/data/tavern/api_server_stats.yaml
@@ -47,7 +47,7 @@ stages:
content-length: !re_match "[0-9]+"
status_code: 200
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
expression: "{{(?=.*'total': [0-9]+)(?=.*'month': [0-9]+)(?=.*'week': [0-9]+)(?=.*'day': [0-9]+)(?=.*'servers': .*).*}}"
diff --git a/tests/data/tavern/api_version.yaml b/tests/data/tavern/api_version.yaml
index ca11906cc9..8e81493353 100755
--- a/tests/data/tavern/api_version.yaml
+++ b/tests/data/tavern/api_version.yaml
@@ -35,7 +35,7 @@ stages:
content-type: !re_match "text/plain"
content-type: !re_search "charset=(UTF|utf)-8"
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
expression: "{SAB_VERSION}"
@@ -53,6 +53,6 @@ stages:
content-type: !re_match "text/xml"
content-type: !re_search "charset=(UTF|utf)-8"
verify_response_with:
- function: tavern.testutils.helpers:validate_regex
+ function: tavern.helpers:validate_regex
extra_kwargs:
expression: '<\?xml version="1.0" encoding="UTF-8" \?>\r?\n?<version>{SAB_VERSION}</version>'
diff --git a/tests/requirements.txt b/tests/requirements.txt
index ea2fe6c403..60c160fe40 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -9,7 +9,7 @@ pytest-httpbin
pytest-httpserver
flaky
xmltodict
-tavern<2.0.0 # tavalidate does not support tavern 2.0.0+
+tavern>=2.0.0
tavalidate
importlib_metadata
lxml
|