blob: 4ad1374dd1558189edb3278f79ea99029c9f4bcc [file] [log] [blame]
adminbae64d82013-08-01 10:50:15 -07001This example shows the usage of the assert
2assert_equal :
3-------------
4utilities.assert_equals(expect=1,actual=1,
5 onpass="Expected result equal to Actual",
6 onfail="Expected result not equal to Actual")
7
8assert_matches:
9--------------
10expect = "Res(.*)"
11actual = "Result : Test Passed"
12utilities.assert_equals(expect=expect,actual=actual,
13 onpass="Expected result matches with Actual",
14 onfail="Expected result didn't matched with Actual")
15
16assert_greater:
17--------------
18expect = 10
19 actual = 5
20 utilities.assert_greater(expect=expect,actual=actual,
21 onpass=str(expect)+" greater than the "+str(actual),
22 onfail=str(expect)+" is not greater than "+str(actual))
23
24assert_lesser:
25-------------
26expect = 5
27 actual = 10
28 utilities.assert_lesser(expect=expect,actual=actual,
29 onpass=str(expect)+" is lesser than the "+str(actual),
30 onfail=str(expect)+" is not lesser than the "+str(actual))
31
32
33cd ~/bin/
34./launcher --example Assert
35 will execute this example.