From 9393f3d60668ff01426691c1e1e8d624cf644b04 Mon Sep 17 00:00:00 2001 From: Jason <93489427+JPLahoda@users.noreply.github.com> Date: Fri, 28 Feb 2025 17:47:03 +0000 Subject: [PATCH 1/4] Automated Unit Testing (Jason) --- .../numbers_test.cpython-312-pytest-8.3.4.pyc | Bin 0 -> 393 bytes .../unit_test.cpython-312-pytest-8.3.4.pyc | Bin 0 -> 4512 bytes Feedstack/numbers_test.py | 2 ++ Feedstack/requirements.txt | 3 ++- Feedstack/unit_test.py | 14 ++++++++++++++ 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Feedstack/__pycache__/numbers_test.cpython-312-pytest-8.3.4.pyc create mode 100644 Feedstack/__pycache__/unit_test.cpython-312-pytest-8.3.4.pyc create mode 100644 Feedstack/numbers_test.py create mode 100644 Feedstack/unit_test.py diff --git a/Feedstack/__pycache__/numbers_test.cpython-312-pytest-8.3.4.pyc b/Feedstack/__pycache__/numbers_test.cpython-312-pytest-8.3.4.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb50eb8cab2b34d938f03427b8cedf82555533dc GIT binary patch literal 393 zcmX|5yH3ME5Ztu`c{u_~x)eyr1xbZy5Tc?&Y3SToj_*JwesOnJWRxOB3iyJ21D`?7 z51?x(sOXR^npEsraaP*dnbpqReGCRYpi+PD52rN0jcCf+lIn!W8W=E)!NYo5i5*%9 zNz2v zgOJN{F0w}+sF?CBpObGa}g=7yStTcH@hC0&AA_l`bp8E kc+oY`CfIZ?lZ+KHzY>Qe>kl0e`Lz-83t$BmARg6*f8SPR_W%F@ literal 0 HcmV?d00001 diff --git a/Feedstack/__pycache__/unit_test.cpython-312-pytest-8.3.4.pyc b/Feedstack/__pycache__/unit_test.cpython-312-pytest-8.3.4.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e597fdfae857056ab55cb871785c72a74012172d GIT binary patch literal 4512 zcmeGg%Wm67a95-xQk48?g4PC-z%~@X1mcGjKaskq5A87@;0r;EbShh~Ea@h4DWGU` zYY)CvhaPk-{1rX-Vp(<_5D0qc$+rSVFFti$Tm&*`% zzWej%7g~al-;oF(p!svT2GbA3A{MQXEz0LaRVpPYsmfbPDppckDOgEV(p6+|LOe0_wNynv?!bc=~x$_UOMUm3RH;dDW1x^faFO-bO8yvKo)iW2VEc? zp0Tkr`KHrC8B$IS<*Z!L1v1u%HR@%8E}#wF1+>soIA7}mY3Kq945_8!O(3X*L@Vv3 zp(d1pdQhTzkl|L4^|Bz5^JFi_t3vhEA*w=!su)9^yQ&C#wI_$Uxutrtp`0}yRE1`J zVBPbypeja&u8NV+QaJxZRme~oDvWF^*ChJ==NEV_yuh2&MG}BcuM!&@Iz3o_Jlkll z=uYOV0GZmDLTpiYW^pd+&J)g9(j7h1n%WS{>$=0xn4a_{5Jpf$u!LX*!TQ0d={PoX zxptwTJHFg#777=5_hT3hcz=d2RzvTA#JtZ9xL+P{Ux4uRBva88-ZatSGJ;j^WO2|p zyaQ(!!Q%#6T?;(|a-&D?yYG^d_zH2K46knJbB&DvHs}&|i@RLXRlZMt=F>*gwH?NrXJ2qPIM>hF3m+Q697^^e?p0QJBRns->*NuuR5C#M3yj94FS| z#Ht8Um@X_1P{p|5Qk+*hPIo_4?>3IuhIy^b?_AGr~LY27&Q7@~fP`gl~c98D9y{CN=>K zf6@@A*}V8f;e?rI_A6F);be+femdZ>4^by2RQzo4uMPec^23pTbw3fd0Ag$oz?JfG mwQlWK>`&M#kk~Pt`vCrsD5bv<@`ikydq?t@N|HY2T7Lm+1U}pV literal 0 HcmV?d00001 diff --git a/Feedstack/numbers_test.py b/Feedstack/numbers_test.py new file mode 100644 index 0000000000..f223b40368 --- /dev/null +++ b/Feedstack/numbers_test.py @@ -0,0 +1,2 @@ +def add_numbers(a, b): + return a + b \ No newline at end of file diff --git a/Feedstack/requirements.txt b/Feedstack/requirements.txt index e1361c9bdb..eda170ec8e 100644 --- a/Feedstack/requirements.txt +++ b/Feedstack/requirements.txt @@ -8,4 +8,5 @@ python-dotenv scikit-learn nltk seaborn -matplotlib \ No newline at end of file +matplotlib +pytest \ No newline at end of file diff --git a/Feedstack/unit_test.py b/Feedstack/unit_test.py new file mode 100644 index 0000000000..0fc65738d3 --- /dev/null +++ b/Feedstack/unit_test.py @@ -0,0 +1,14 @@ +import pytest +from numbers_test import add_numbers + + +# Test function to check the addition of two numbers +def test_add_numbers(): + assert add_numbers(2, 3) == 5 # Test 1: Should return 5 + assert add_numbers(1, 1) == 2 # Test 2: Should return 2 + assert add_numbers(0, 0) == 0 # Test 3: Should return 0 + assert add_numbers(-1, 1) == 0 # Test 4: Should return 0 + assert add_numbers(-2, -3) == -5 # Test 5: Should return -5 + + +# To run the tests, run: pytest unit_test.py From 496691074c1ecca0556483d9892b816db799a71f Mon Sep 17 00:00:00 2001 From: Jason <93489427+JPLahoda@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:30:39 +0000 Subject: [PATCH 2/4] Automated Unit Testing 2 --- .../unit_test.cpython-312-pytest-8.3.4.pyc | Bin 4512 -> 4512 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Feedstack/__pycache__/unit_test.cpython-312-pytest-8.3.4.pyc b/Feedstack/__pycache__/unit_test.cpython-312-pytest-8.3.4.pyc index e597fdfae857056ab55cb871785c72a74012172d..a0ce3e7bf1e13031b36de0a496d8ef35b1b1154b 100644 GIT binary patch delta 26 gcmZ3Wyg-@jG%qg~0}vehzL9GU3nSO&?JO^O0A_Ir761SM delta 26 gcmZ3Wyg-@jG%qg~0}yn7-N?0ug^_#nc9xes0ApYW+5i9m From eafcc89ef9383802fbf4383776324f8368d52819 Mon Sep 17 00:00:00 2001 From: Jason <93489427+JPLahoda@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:38:49 +0000 Subject: [PATCH 3/4] Automated Unit Testing 3 --- .github/workflows/unit_tests.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 0000000000..0cd8ac639b --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,46 @@ +name: Run Unit Tests + + +on: + pull_request: + branches: + # GUYS, ADD YOUR BRANCHES HERE: + - JasonWorking + - omarshakir8-UnitTestsDoc1 + - omarshakir8-integration-testsdoc + # - [YOUR BRANCH HERE] + push: + branches: + - main + - JasonWorking # Runs automatically when changes are pushed to 'JasonWorking' branch. You should see a check mark or an 'X'! + - omarshakir8-UnitTestsDoc1 + - omarshakir8-integration-testsdoc + # GUYS, ADD YOUR BRANCHES HERE: + # - [YOUR BRANCH HERE] + + +jobs: + test: + runs-on: ubuntu-latest + + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt # Install dependencies, including pytest + + + - name: Run tests + run: | + pytest --maxfail=1 --disable-warnings -q # Run pytest and fail after 1 failure From b59874df4e7e4f4c58accf5d861325896592908a Mon Sep 17 00:00:00 2001 From: Jason <93489427+JPLahoda@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:43:24 +0000 Subject: [PATCH 4/4] Automated Unit Testing 4 --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0cd8ac639b..f85bc0e5d9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -4,7 +4,7 @@ name: Run Unit Tests on: pull_request: branches: - # GUYS, ADD YOUR BRANCHES HERE: + # GUYS ADD YOUR BRANCHES HERE: - JasonWorking - omarshakir8-UnitTestsDoc1 - omarshakir8-integration-testsdoc