-
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.
Merge pull request #44 from ES2-UFPI/unit-tests-#5
Unit tests #5
- Loading branch information
Showing
8 changed files
with
49 additions
and
7 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
File renamed without changes.
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
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,6 +1,5 @@ | ||
import pytest | ||
import requests | ||
from entrypoints.api.endpoints import cpus | ||
|
||
url = "http://127.0.0.1:5000/api/v1" | ||
|
||
|
File renamed without changes.
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,30 @@ | ||
import pytest | ||
|
||
from ..domain.value_object import Money, URL | ||
from ..domain.rule import BusinessRuleValidationException | ||
|
||
|
||
@pytest.mark.unit | ||
@pytest.mark.domain | ||
def test_money(): | ||
m1 = Money(100) | ||
m2 = Money(100) | ||
m3 = Money(100, "USD") | ||
m4 = Money(150, "USD") | ||
|
||
assert m1 == m2 | ||
assert not (m2 == m3) | ||
assert m3 < m4 | ||
|
||
|
||
@pytest.mark.unit | ||
@pytest.mark.domain | ||
def test_URL(): | ||
u_w_path = URL.get_URL("https://github.com/ES2-UFPI/WiseBuilder") | ||
u_wo_path = URL.get_URL("https://github.com") | ||
|
||
assert u_w_path.domain == "github.com" | ||
assert u_wo_path.domain == "github.com" | ||
|
||
with pytest.raises(BusinessRuleValidationException) as excinfo: | ||
URL.get_URL("github.com/ES2-UFPI/WiseBuilder") |