KNOW YOUR ASSERT WELL
assert = Fail If (read it is print ur passed msg)
------
whatever comes after assert = Negate it
---------------------------
Example:
-------
assertEqual = Fail if if they are not equal
assertTrue = Fail if it is False
assertFalse = Fail if it is True
-----------------------
All Assert Functions For UT
----------------------------
1)assertAlmostEqual
2)assertAlmostEquals
3)assertCountEqual
4)assertDictContainsSubset
5)assertDictEqual
6)assertEqual
7)assertEquals
8)assertFalse
9)assertGreater
10)assertGreaterEqual
11)assertIn
12)assertIs
13)assertIsInstance
14)assertIsNone
15)assertIsNot
16)assertIsNotNone
17)assertLess
18)assertLessEqual
19)assertListEqual
20)assertLogs
21)assertMultiLineEqual
22)assertNotAlmostEqual
23)assertNotAlmostEquals
24)assertNotEqual
25)assertNotEquals
26)assertNotIn
27)assertNotIsInstance
28)assertNotRegex
29)assertRaises
30)assertRaisesRegex
31)assertRaisesRegexp
32)assertRegex
33)assertRegexpMatches
34)assertSequenceEqual
35)assertSetEqual
36)assertTrue
37)assertTupleEqual
38)assertWarns
39)assertWarnsRegex
40)assert_
assert = Fail If (read it is print ur passed msg)
------
whatever comes after assert = Negate it
---------------------------
Example:
-------
assertEqual = Fail if if they are not equal
assertTrue = Fail if it is False
assertFalse = Fail if it is True
-----------------------
All Assert Functions For UT
----------------------------
1)assertAlmostEqual
2)assertAlmostEquals
3)assertCountEqual
4)assertDictContainsSubset
5)assertDictEqual
6)assertEqual
7)assertEquals
8)assertFalse
9)assertGreater
10)assertGreaterEqual
11)assertIn
12)assertIs
13)assertIsInstance
14)assertIsNone
15)assertIsNot
16)assertIsNotNone
17)assertLess
18)assertLessEqual
19)assertListEqual
20)assertLogs
21)assertMultiLineEqual
22)assertNotAlmostEqual
23)assertNotAlmostEquals
24)assertNotEqual
25)assertNotEquals
26)assertNotIn
27)assertNotIsInstance
28)assertNotRegex
29)assertRaises
30)assertRaisesRegex
31)assertRaisesRegexp
32)assertRegex
33)assertRegexpMatches
34)assertSequenceEqual
35)assertSetEqual
36)assertTrue
37)assertTupleEqual
38)assertWarns
39)assertWarnsRegex
40)assert_
Here is the python program which generated the above output
----------------------------------------------------------------------------
import unittest
from pprint import pprint
class myTestClass(unittest.TestCase):
pass
if __name__ == '__main__':
m1 = myTestClass()
j=1
f = open('./assertFun', 'a')
f.write('KNOW YOUR ASSERT WELL\n')
assertDoc = '''
assert = Fail If (read it is print ur passed msg)
------
whatever comes after assert = Negate it
---------------------------
Example:
-------
assertEqual = Fail if if they are not equal
assertTrue = Fail if it is False
assertFalse = Fail if it is True
'''
f.write(assertDoc)
f.write("-----------------------\n")
f.write("All Assert Functions For UT\n")
f.write("----------------------------\n")
for i in dir(m1):
if i.startswith('assert'):
f.write("%d)%s\n" %(j,i))
j=j+1
f.close()
No comments:
Post a Comment