Having knowledge on all telecom(VoIP) protocols, performance tools & test automation using java & python...
Search This Blog........
Monday, 15 January 2018
Learn SIPp (VoIP,SIP,RTP) performance tool in 30 minutes.
Index:
- Introduction about tool.
- How to install SIPp tool in linux.
- How to run basic sipp client and server.
- How to create own xml file and passing values from csv file.
- How to run perform test(FG,BG).
- How to get reports and analyze CC & CPS parameters.
Learn JMeter in 30 Minutes for REST API testing
Index:
- How to install Jmeter.
- How to create thread group, request defaults,manager and sampler.
- How to run thread and verifying results.
- How to pass values from CSV file and from command line.
- How to perform load test
- How to generate HTML reports from the performance test.
Wednesday, 13 July 2016
Python unit testing
Python Unit testing tutorial
Unit test:
Using python default unittest allows you to write more robust tests.
The unittest module provides a runner to execute tests i.e, grouping tests in to logical unit and the concept of setup and teardown.
Lets see one example.....,
import unittest
class Test(unittest.TestCase):
def setUp(self):
self.num=1
def test_math(self):
self.assertEqual(self.num,1)
if __name__ == '__main__':
unittest,main()
Explanation
A testcase is class that inherits from unittest.
The function(def) inside class all require a mandatory parameter named self
When running unittest.main(), that take care of finding all the testcases. Calling setUp method first (whose name start with test) and then finally calling method called tearDown()
The function(def) inside class all require a mandatory parameter named self
When running unittest.main(), that take care of finding all the testcases. Calling setUp method first (whose name start with test) and then finally calling method called tearDown()
Subscribe to:
Comments (Atom)