-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ticket 8211 unit test #190
Conversation
Co-authored-by: esmith1729 <[email protected]> Co-authored-by: Zsolt Kebel <[email protected]>
Co-authored-by: esmith1729 <[email protected]> Co-authored-by: Zsolt Kebel <[email protected]>
Co-authored-by: Zsolt Kebel <[email protected]> Co-authored-by: esmith1729 <[email protected]>
pytest==8.0.0 | ||
pywin32==306 | ||
semantic_version==2.10.0 | ||
six==1.16.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since your adding specific requirements other than the default system ones this should probably use a venv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This txt contains the requirements of the ibex_utils repository (apart from pytest which is only for testing). We needed this file to set up the GitHub runner with the neccessary dependencies to be able to run ibex_util code
from ibex_install_utils.tasks import BaseTasks | ||
from ibex_install_utils.user_prompt import UserPrompt | ||
|
||
EPICS_PATH_BACKUP = os.path.join(BaseTasks._get_backup_dir(),'EPICS', 'VERSION.txt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseTasks._get_backup_dir()
raises an exception on machines without a C:\\Data
directory, which is not guaranteed to be present on a developer machine. As this is done before running the tests, this prevents them from running instead of failing the test.
It might be worth running this with os.path.exists()
mocked out so that whether this test runs is not coupled to whether the machine has a specific folder present.
@patch('sys.stdout', new_callable=io.StringIO) | ||
def test_WHEN_updating_THEN_progress_bar_works(self, mockstdout): | ||
|
||
BackupTasks('','','','','').update_progress_bar(10, 20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth creating a variable empty_argument = ''
or the like, just for clarity.
Co-authored-by: esmith1729 <[email protected]> Co-authored-by: Zsolt Kebel <[email protected]>
Co-authored-by: esmith1729 <[email protected]> Co-authored-by: Zsolt Kebel <[email protected]>
…h and explained the empty strings within the constructor Co-authored-by: esmith1729 <[email protected]> Co-authored-by: Zsolt Kebel <[email protected]>
Created a framework for unit testing & unit tests for a few backup tasks