-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add `package_exists` test case add `valid_package_invalid_credentials` test case add `valid_package_valid_credentials` test case
- Loading branch information
Showing
1 changed file
with
15 additions
and
3 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,9 +1,21 @@ | ||
from reserver import Uploader | ||
from reserver.util import get_random_name | ||
import os | ||
test_pypi_token = os.environ.get("TEST_PYPI_PASSWORD") | ||
|
||
def test_reserver(): | ||
|
||
def test_package_exists(): | ||
# test reserved name | ||
uploader = Uploader(test_pypi_token, is_test_pypi_account= True) | ||
uploader.upload_to_pypi("numpy") | ||
assert uploader.upload_to_pypi("numpy") == False | ||
|
||
def test_valid_package_invalid_credentials(): | ||
# test not reserved name -> wrong credentials | ||
wrong_pypi_token = "pypi-wrong-api-token" | ||
uploader = Uploader(wrong_pypi_token, is_test_pypi_account= True) | ||
assert uploader.upload_to_pypi(get_random_name()) == False | ||
|
||
def test_valid_package_valid_credentials(): | ||
# test not reserved name -> correct credentials | ||
# uploader = Uploader(test_pypi_token, is_test_pypi_account= True) | ||
# uploader.upload_to_pypi(get_random_name()) | ||
assert True == True |