admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | ''' |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 2 | Copyright 2013 Open Networking Foundation (ONF) |
| 3 | |
| 4 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 7 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 8 | |
| 9 | TestON is free software: you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by |
| 11 | the Free Software Foundation, either version 2 of the License, or |
| 12 | (at your option) any later version. |
| 13 | |
| 14 | TestON is distributed in the hope that it will be useful, |
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | GNU General Public License for more details. |
| 18 | |
| 19 | You should have received a copy of the GNU General Public License |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 20 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 21 | |
| 22 | |
| 23 | ''' |
| 24 | class Assert : |
| 25 | |
| 26 | def __init__(self) : |
| 27 | self.default = '' |
| 28 | |
| 29 | def CASE1(self,main) : |
| 30 | |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 31 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 32 | main.case("Using assert to verify the result") |
| 33 | main.step("Using assert_equal to verify the result is equivalent or not") |
| 34 | expect = main.TRUE |
| 35 | actual = main.TRUE |
| 36 | main.log.warn(main.response_parser('<real></real><imag>2</imag><__complex__>true</__complex__>', "json")) |
| 37 | utilities.assert_equals(expect=expect,actual=actual,onpass="expect is equal to actual",onfail="expect is not equal to actual") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 38 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 39 | main.step("Using assert_matches to verify the result matches or not") |
| 40 | expect = "Res(.*)" |
| 41 | actual = "Result" |
| 42 | utilities.assert_matches(expect=expect,actual=actual,onpass="expect is macthes to actual",onfail="expect is not matches to actual") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 43 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 44 | main.step("Using assert_greater to verify the result greater or not") |
| 45 | expect = 10 |
| 46 | actual = 5 |
| 47 | utilities.assert_greater(expect=actual,actual=expect,onpass="expect is greater than the actual",onfail="expect is not greater than the actual") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 48 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 49 | main.step("Using assert_lesser to verify the result lesser or not") |
| 50 | expect = 5 |
| 51 | actual = 10 |
| 52 | utilities.assert_lesser(expect=actual,actual=expect,onpass="expect is lesser than the actual",onfail="expect is not lesser than the actual") |