-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
104e712
commit 7f02f84
Showing
3 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
from strong_but_simple_passwords.core import sentences | ||
|
||
|
||
def test_index_http_ok(client): | ||
response = client.get("/") | ||
assert response.status_code == 200 | ||
|
||
|
||
def test_empty_post(client): | ||
response = client.post("/") | ||
|
||
is_sentence_in = [cur_sentence in str(response.data) for cur_sentence in sentences] | ||
|
||
assert response.status_code == 200 | ||
assert any(is_sentence_in) | ||
|
||
|
||
def test_strong_password(client): | ||
payload = {"input_sentence": "A very long input sentence for a strong password"} | ||
response = client.post("/", data=payload) | ||
|
||
assert response.status_code == 200 | ||
assert b"Congratulations!" in response.data | ||
assert b"centuries" in response.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
def test_css_http_ok(app, client): | ||
def test_css_http_ok(client): | ||
response = client.get("/static/css/styles.css") | ||
assert response.status_code == 200 | ||
|
||
response = client.get("/static/css/normalize.css") | ||
assert response.status_code == 200 | ||
|
||
|
||
def test_img_http_ok(app, client): | ||
def test_img_http_ok(client): | ||
response = client.get("/static/img/GitHub-Mark-64px.png") | ||
assert response.status_code == 200 |