From 2e79dc5a88c90b7b4d03f76e4a18e76ccce12f3c Mon Sep 17 00:00:00 2001 From: Zach Sais Date: Wed, 22 Apr 2015 11:41:31 -0500 Subject: [PATCH] Added unit test to verify num vals in str_to_num Added new unit test to verify that an int is of type numbers.Number when an int is passed into translator.common.utils.str_to_num() Change-Id: Ibce8a3c6fd60a337b39181ab1d9f3edc2ddc79a8 --- translator/tests/test_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/translator/tests/test_utils.py b/translator/tests/test_utils.py index 8523a77..6780cd5 100644 --- a/translator/tests/test_utils.py +++ b/translator/tests/test_utils.py @@ -66,3 +66,8 @@ class CommonUtilsTest(TestCase): self.assertFalse(self.cmpUtils.compare_dicts(None, None)) self.assertFalse(self.cmpUtils.compare_dicts(None, {})) self.assertFalse(self.cmpUtils.compare_dicts(None, {'x': '2'})) + + def test_assert_value_is_num(self): + value = 1 + output = translator.common.utils.str_to_num(value) + self.assertEqual(value, output)