File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 1+ name : My first Test
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - develop
7+
8+ jobs :
9+ test :
10+ runs-on : [ubuntu-latest, windows-latest]
11+ defaults :
12+ run :
13+ working-directory : ./
14+ strategy :
15+ matrix :
16+ python-version : [3.8, 3.12]
17+
18+ env :
19+ NFAK : " 1"
20+
21+ steps :
22+ - uses : actions/checkout@v3
23+ - name : Set up Environment
24+ uses : actions/setup-python@v4
25+ with :
26+ python-version : ${{ matrix.python-version}}
27+
28+ - name : Install Dependencies
29+ run :
30+ python -m pip install --upgrade pip
31+ pip install -r unittest
32+
33+ - name : Test Function
34+ run : python ./faculty_test.py
Original file line number Diff line number Diff line change 1+ import os
2+
13def my_faculty (n ):
4+ if isinstance (n , str ):
5+ n = int (os .environ .get (n ))
26 mul = 1
37 if n == 0 :
48 return 1
Original file line number Diff line number Diff line change 22from faculty import my_faculty
33
44class MyTest (unittest .TestCase ):
5- def test (self ):
5+ def test5 (self ):
66 self .assertEqual (my_faculty (5 ), 120 )
7+ def test0 (self ):
8+ self .assertEqual (my_faculty (0 ), 1 )
9+ def testEnviron (self ):
10+ self .assertEqual (my_faculty ("NFAK" ), 1 )
711
12+ if __name__ == "__main__" :
13+ unittest .main ()
You can’t perform that action at this time.
0 commit comments