From 1efb0a497bdace2e343e1d4b44084db28ca3ed49 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 30 Jun 2017 16:57:56 +0800 Subject: [PATCH] bugfix: length equal --- ate/utils.py | 2 +- test/test_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ate/utils.py b/ate/utils.py index a9685349..97a3e7a5 100644 --- a/ate/utils.py +++ b/ate/utils.py @@ -195,7 +195,7 @@ def match_expected(value, expected, comparator="eq"): elif comparator in ["ne", "not_equals"]: assert value != expected elif comparator in ["len_eq", "length_equal", "count_eq"]: - assert len(value) == len(expected) + assert len(value) == expected elif comparator in ["lt", "less_than"]: assert value < expected elif comparator in ["le", "less_than_or_equals"]: diff --git a/test/test_utils.py b/test/test_utils.py index a607ce46..8e4cbe28 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -184,7 +184,7 @@ class TestUtils(ApiServerUnittest): self.assertFalse(utils.match_expected(123, "123", "eq")) self.assertFalse(utils.match_expected(123, "123")) - self.assertTrue(utils.match_expected("123", "345", "len_eq")) + self.assertTrue(utils.match_expected("123", 3, "len_eq")) self.assertTrue(utils.match_expected(123, "123", "str_eq")) self.assertTrue(utils.match_expected(123, "123", "ne"))