Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hübner, Jan-Ole
lab-containerization
Commits
bab9d537
Commit
bab9d537
authored
Sep 18, 2020
by
Nane Kratzke
Browse files
Unit test
parent
9357954c
Changes
2
Hide whitespace changes
Inline
Side-by-side
unit/Requirements.txt
0 → 100644
View file @
bab9d537
requests
BeautifulSoup4
\ No newline at end of file
unit/test.py
0 → 100644
View file @
bab9d537
import
requests
import
sys
from
bs4
import
BeautifulSoup
url
=
sys
.
argv
[
1
]
content
=
sys
.
argv
[
2
]
page
=
BeautifulSoup
(
requests
.
get
(
url
).
text
,
'html.parser'
)
if
not
page
.
title
.
text
==
content
:
print
(
f
"Wrong title: '
{
page
.
title
.
text
}
' should be '
{
content
}
'"
)
exit
(
1
)
if
not
page
.
h1
.
text
==
content
:
print
(
f
"Wrong h1: '
{
page
.
h1
.
text
}
' should be '
{
content
}
'"
)
exit
(
1
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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