match_expected comparator: add len_gt, len_lt, len_ge, len_le, etc.

This commit is contained in:
debugtalk
2017-06-30 17:04:20 +08:00
parent 1efb0a497b
commit 31a98501ca
2 changed files with 15 additions and 0 deletions

View File

@@ -188,6 +188,11 @@ class TestUtils(ApiServerUnittest):
self.assertTrue(utils.match_expected(123, "123", "str_eq"))
self.assertTrue(utils.match_expected(123, "123", "ne"))
self.assertTrue(utils.match_expected("123", 2, "len_gt"))
self.assertTrue(utils.match_expected("123", 3, "len_ge"))
self.assertTrue(utils.match_expected("123", 4, "len_lt"))
self.assertTrue(utils.match_expected("123", 3, "len_le"))
self.assertTrue(utils.match_expected(1, 2, "lt"))
self.assertTrue(utils.match_expected(1, 1, "le"))
self.assertTrue(utils.match_expected(2, 1, "gt"))