| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Splunk
- ipad
- pycharm
- DFS
- mean
- Series
- LSTM
- Python
- Numpy
- dataframe
- pandas
- index
- 알고리즘
- pip
- javascript
- E-P1
- keras
- mariadb
- Button
- Lotto
- 삼성소프트웨어멤버십
- SciPy
- GT-S80
- CNN
- synology
- GitHub
- SPL
- install
- RNN
- imread
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