Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian New Member Process
nm.debian.org
Commits
764b2d8f
Commit
764b2d8f
authored
May 31, 2016
by
Enrico Zini
Browse files
Added a new test utility
parent
a27347e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/unittest.py
View file @
764b2d8f
...
@@ -379,3 +379,21 @@ class ExpectedPerms(object):
...
@@ -379,3 +379,21 @@ class ExpectedPerms(object):
self
.
update_advs
({
visitors
:
PatchDiff
(
text
)
})
self
.
update_advs
({
visitors
:
PatchDiff
(
text
)
})
class
PageElements
(
dict
):
"""
List of all page elements possibly expected in the results of a view.
dict matching name used to refer to the element with regexp matching the
element.
"""
def
add_id
(
self
,
id
):
self
[
id
]
=
re
.
compile
(
r
"""id\s*=\s*["']{}["']"""
.
format
(
re
.
escape
(
id
)))
def
add_class
(
self
,
cls
):
self
[
cls
]
=
re
.
compile
(
r
"""class\s*=\s*["']{}["']"""
.
format
(
re
.
escape
(
cls
)))
def
add_href
(
self
,
name
,
url
):
self
[
name
]
=
re
.
compile
(
r
"""href\s*=\s*["']{}["']"""
.
format
(
re
.
escape
(
url
)))
def
add_string
(
self
,
name
,
term
):
self
[
name
]
=
re
.
compile
(
r
"""{}"""
.
format
(
re
.
escape
(
term
)))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment