-
Notifications
You must be signed in to change notification settings - Fork 21
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
605d0ee
commit 8fde3e3
Showing
7 changed files
with
2,946 additions
and
3 deletions.
There are no files selected for viewing
Empty file.
908 changes: 908 additions & 0 deletions
908
...r/carriers/mondialrelay_fr/tests/cassettes/test_mondialrelay/test_mondialrelay_label.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
908 changes: 908 additions & 0 deletions
908
...ers/mondialrelay_fr/tests/cassettes/test_mondialrelay/test_mondialrelay_label_return.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
1,047 changes: 1,047 additions & 0 deletions
1,047
...iers/mondialrelay_fr/tests/cassettes/test_mondialrelay/test_mondialrelay_pickup_site.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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,6 @@ | ||
# Copyright 2024 Akretion (http://www.akretion.com). | ||
# @author Florian Mounier <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from ....tests.conftest import * # noqa |
72 changes: 72 additions & 0 deletions
72
roulier/carriers/mondialrelay_fr/tests/test_mondialrelay.py
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,72 @@ | ||
# Copyright 2024 Akretion (http://www.akretion.com). | ||
# @author Florian Mounier <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
import pytest | ||
from roulier import roulier | ||
from ....helpers import merge | ||
|
||
|
||
@pytest.fixture | ||
def get_label_data(credentials, base_get_label_data): | ||
return merge( | ||
credentials["mondialrelay_fr"], | ||
base_get_label_data, | ||
{ | ||
"service": { | ||
"product": "HOM", | ||
"pickupMode": "REL", | ||
"pickupSite": "AUTO", | ||
"pickupCountry": "FR", | ||
} | ||
}, | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def find_pickup_site_data(credentials, base_find_pickup_site_data): | ||
return merge( | ||
credentials["mondialrelay_fr"], | ||
base_find_pickup_site_data, | ||
) | ||
|
||
|
||
@pytest.mark.vcr() | ||
def test_mondialrelay_label(get_label_data): | ||
rv = roulier.get("mondialrelay_fr", "get_label", get_label_data) | ||
assert "parcels" in rv | ||
assert "label" in rv["parcels"][0] | ||
label = rv["parcels"][0]["label"] | ||
assert label["name"] == "label_url" | ||
assert label["type"] == "url" | ||
assert label["data"].startswith("https://www.mondialrelay.com") | ||
|
||
|
||
@pytest.mark.vcr() | ||
def test_mondialrelay_label_return(get_label_data): | ||
rv = roulier.get( | ||
"mondialrelay_fr", | ||
"get_label", | ||
merge( | ||
get_label_data, | ||
{ | ||
"service": { | ||
"product": "LCC", | ||
}, | ||
}, | ||
), | ||
) | ||
assert "parcels" in rv | ||
assert "label" in rv["parcels"][0] | ||
label = rv["parcels"][0]["label"] | ||
assert label["name"] == "label_url" | ||
assert label["type"] == "url" | ||
assert label["data"].startswith("https://www.mondialrelay.com") | ||
|
||
|
||
@pytest.mark.vcr() | ||
def test_mondialrelay_pickup_site(find_pickup_site_data): | ||
rv = roulier.get("mondialrelay_fr", "find_pickup_site", find_pickup_site_data) | ||
assert "sites" in rv | ||
assert len(rv["sites"]) > 0 | ||
assert "name" in rv["sites"][0] |
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