Skip to content

Commit

Permalink
split test cases
Browse files Browse the repository at this point in the history
add `package_exists` test case
add `valid_package_invalid_credentials` test case
add `valid_package_valid_credentials` test case
  • Loading branch information
AHReccese committed Jan 20, 2024
1 parent e8e63e4 commit 6d07a8f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/test_reserver.py
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

0 comments on commit 6d07a8f

Please sign in to comment.