forked from ynput/OpenPype
-
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.
Fix and improve unit tests and add a launcher
- Loading branch information
1 parent
389cee6
commit 77ae661
Showing
3 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
openpype/modules/shotgrid/tests/shotgrid/lib/test_credentials.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,34 @@ | ||
import pytest | ||
from assertpy import assert_that | ||
|
||
import openpype.modules.shotgrid.lib.credentials as sut | ||
|
||
|
||
def test_missing_shotgrid_url(): | ||
with pytest.raises(Exception) as ex: | ||
# arrange | ||
url = "" | ||
# act | ||
sut.get_shotgrid_hostname(url) | ||
# assert | ||
assert_that(ex).is_equal_to("Shotgrid url cannot be a null") | ||
|
||
|
||
def test_full_shotgrid_url(): | ||
# arrange | ||
url = "https://shotgrid.com/myinstance" | ||
# act | ||
actual = sut.get_shotgrid_hostname(url) | ||
# assert | ||
assert_that(actual).is_not_empty() | ||
assert_that(actual).is_equal_to("shotgrid.com") | ||
|
||
|
||
def test_incomplete_shotgrid_url(): | ||
# arrange | ||
url = "shotgrid.com/myinstance" | ||
# act | ||
actual = sut.get_shotgrid_hostname(url) | ||
# assert | ||
assert_that(actual).is_not_empty() | ||
assert_that(actual).is_equal_to("shotgrid.com") |
This file was deleted.
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,3 @@ | ||
export OPENPYPE_DATABASE_NAME=test; | ||
export PYTHONPATH="./;./repos/avalon-core;$PYTHONPATH"; | ||
pytest openpype/modules/shotgrid --capture=sys --print -W ignore::DeprecationWarning |