Skip to content

Commit

Permalink
update testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
AHReccese committed Apr 15, 2024
1 parent 3d31199 commit 7c5b013
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_reserver.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
from reserver import Uploader
from reserver import PyPIUploader
from reserver.reserver_func import get_random_name
import os
test_pypi_token = os.environ.get("TEST_PYPI_PASSWORD")

def test_package_exists():
# test reserved name
uploader = Uploader(test_pypi_token, test_pypi= True)
assert uploader.upload_to_pypi("numpy") == False
uploader = PyPIUploader(test_pypi_token, test_pypi= True)
assert uploader.upload("numpy") == False

def test_batch_packages_names():
# test batch of package names
uploader = Uploader(test_pypi_token, test_pypi= True)
uploader.batch_upload_to_pypi("numpy", "scikit-learn")
uploader = PyPIUploader(test_pypi_token, test_pypi= True)
uploader.batch_upload("numpy", "scikit-learn")
assert True == True

def test_valid_package_invalid_credentials():
# test not reserved name -> wrong credentials
wrong_pypi_token = "pypi-wrong-api-token"
uploader = Uploader(wrong_pypi_token, test_pypi= True)
assert uploader.upload_to_pypi(get_random_name()) == False
uploader = PyPIUploader(wrong_pypi_token, test_pypi= True)
assert uploader.upload(get_random_name()) == False

def test_valid_package_valid_credentials():
# test not reserved name -> correct credentials
# uploader = Uploader(test_pypi_token, test_pypi= True)
# uploader = PyPIUploader(test_pypi_token, test_pypi= True)
# uploader.upload_to_pypi(get_random_name())
assert True == True

0 comments on commit 7c5b013

Please sign in to comment.