admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | This example shows the usage of the assert |
| 2 | assert_equal : |
| 3 | ------------- |
| 4 | utilities.assert_equals(expect=1,actual=1, |
| 5 | onpass="Expected result equal to Actual", |
| 6 | onfail="Expected result not equal to Actual") |
| 7 | |
| 8 | assert_matches: |
| 9 | -------------- |
| 10 | expect = "Res(.*)" |
| 11 | actual = "Result : Test Passed" |
| 12 | utilities.assert_equals(expect=expect,actual=actual, |
| 13 | onpass="Expected result matches with Actual", |
| 14 | onfail="Expected result didn't matched with Actual") |
| 15 | |
| 16 | assert_greater: |
| 17 | -------------- |
| 18 | expect = 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 | |
| 24 | assert_lesser: |
| 25 | ------------- |
| 26 | expect = 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 | |
| 33 | cd ~/bin/ |
| 34 | ./launcher --example Assert |
| 35 | will execute this example. |