forked from VenkateshDoijode/selenium_with_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnitTestExample.py
More file actions
38 lines (28 loc) · 1.02 KB
/
UnitTestExample.py
File metadata and controls
38 lines (28 loc) · 1.02 KB
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
32
33
34
35
36
37
38
'''
Created on 04-Jul-2020
@author: venkateshwara D
'''
import HtmlTestRunner
import unittest
# import sys
# import os
# sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
from resources import Examples
Example = Examples.Example
class Test(unittest.TestCase):
def setUp(self):
print ("Running before test")
# unittest.TestCase.setUp(self)
def tearDown(self):
# unittest.TestCase.tearDown(self)
print ("Runnig after test")
def test_add(self):
#result = Example.add(self, 10, 20)
self.assertEqual(Example.add(self, 10, 20),30)
self.assertEqual(Example.add(self, 1, 2),3)
self.assertEqual(Example.add(self, 0, 0),0)
self.assertEqual(Example.add(self, -10, 20),10)
self.assertEqual(Example.add(self, -10, -20),-30)
if __name__ == '__main__':
#import sys;sys.argv = ['', 'Test.testName']
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output='../Report'))