For this assignment, I made a simple calculator. I will explain how to use this repo in the following steps. This repo is a simple workflow example which I will use as template to do further assignments and final project.
- Open Terminal in your software.
- Clone this repository by using the following command:
git clone https://github.com/JerryV77/CS6620-Assignment-1.git
- Navigate to the repository directory
-
Ensure you have the latest version of Python is installed:
- Make sure Python 3.13 is installed on your machine. You can download it from python.org.
-
Create a Virtual Environment (optional but strongly recommended):
python -m venv venv
-
Activate the Virtual Environment:
- On macOS/Linux:
source venv/bin/activate
- On Windows:
.\venv\Scripts\activate
- Install Dependencies using 'pip' command:
pip install -r requirements.txt
-
Run the Main Script:
python main.py
This script contains four functions: add, subtract, multiply and divide. Running this script will execute these functions and print their results.
-
Run the Tests using unittest:
python -m unittest discover -s . -p "test.py"
This command will discover and run the tests defined in test.py to ensure the functions in main.py are working correctly.
-
When you run the tests using python -m unittest discover -s . -p "test.py", you should see an output indicating the tests passed:
... ---------------------------------------------------------------------- Ran 4 tests in 0.001s OK
- "main.yml" file shown the whole workflow process for this assignment. Please check it if you get any type of error.
By following above instructions, you should be able to run the code and tests in the repository successfully. If you encounter any issues, ensure that Python and all required dependencies are correctly installed.