-
Notifications
You must be signed in to change notification settings - Fork 0
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
f6d57d0
commit 6933dd8
Showing
5 changed files
with
25 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
__pycache__ | ||
venv | ||
.env | ||
.env | ||
test.db |
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from ..test_setup import test_db, client | ||
|
||
prefix = "/url" | ||
|
||
|
||
def test_create_url(test_db): | ||
original_url = "http://test.com" | ||
response = client.post(prefix, json={"originalUrl": original_url}) | ||
result = response.json() | ||
|
||
assert response.status_code == 201 | ||
assert result['id'] >= 0 | ||
assert result['originalUrl'] == original_url | ||
assert len(result['shortenedUrl']) >= 4 |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from ..test_setup import test_db, client | ||
|
||
|
||
def test_read_root(test_db): | ||
response = client.get("/") | ||
|
||
assert response.status_code == 200 | ||
assert response.json() == {"message": "Welcome to MinionUrl."} |