| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- SPL
- mean
- Splunk
- index
- Button
- dataframe
- mariadb
- E-P1
- install
- Series
- RNN
- CNN
- Lotto
- ipad
- keras
- synology
- DFS
- GitHub
- imread
- LSTM
- GT-S80
- Numpy
- 삼성소프트웨어멤버십
- pip
- SciPy
- pycharm
- 알고리즘
- Python
- pandas
- javascript
Archives
- Today
- Total
잠토의 잠망경
[python] unitest 본문
pycharm에서는 실행에 unitest 부분이 있다.
이걸로 실행한다.
sample code
def add(a, c):
return a+c
def mul(a, c):
return a*c
def divided(a, c):
return a/c
test code
import unittest
import sample.myCalc as myCalc
class myCalcTest(unittest.TestCase):
def test_add(self):
c = myCalc.add(10, 30)
self.assertEqual(c, 40)
def test_mul(self):
c = myCalc.mul(10, 30)
self.assertEqual(c, 300)
def test_divided(self):
c = myCalc.divided(10, 30)
self.assertEqual(c, 0)
if __name__ == '__main__':
unittest.main()
Comments