Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewReid854 committed Apr 3, 2021
1 parent 131a6e3 commit 41bb7cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions check4updates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def __init__(
online_check_interval=6048000,
mock_user_input=None,
):
if type(package_name) is not str:
raise ValueError("package_name must be a string")
self.package_name = package_name

start_time = time.time() # used for timing the execution of this script
Expand Down
5 changes: 5 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import re
import requests
import pytest

def cleanup(package_name):
cwd = os.getcwd()
Expand All @@ -14,6 +15,10 @@ def cleanup(package_name):
pass
os.chdir(path=cwd) # reset the current working directory

def test_packagename_not_str():
with pytest.raises(ValueError):
check_and_prompt(package_name=True)

def test_choice_upgrade():
package_name = 'numpy'
cleanup(package_name)
Expand Down

0 comments on commit 41bb7cf

Please sign in to comment.