From 73223fcb238959986f90635932d67c441d10a448 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 7 Jul 2014 23:40:37 +0300 Subject: [PATCH] Test isStringType and isPath in similar way to production code --- Tests/test_util.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Tests/test_util.py b/Tests/test_util.py index 8cf73f47f..a87a7833c 100644 --- a/Tests/test_util.py +++ b/Tests/test_util.py @@ -7,40 +7,41 @@ class TestUtil(PillowTestCase): def test_is_string_type(self): # Arrange - text = "abc" + color = "red" # Act - it_is = _util.isStringType(text) + it_is = _util.isStringType(color) # Assert self.assertTrue(it_is) def test_is_not_string_type(self): # Arrange - integer = 123 + color = (255, 0, 0) # Act - it_is_not = _util.isStringType(integer) + it_is_not = _util.isStringType(color) # Assert self.assertFalse(it_is_not) def test_is_path(self): # Arrange - text = "abc" + fp = "filename.ext" # Act - it_is = _util.isStringType(text) + it_is = _util.isStringType(fp) # Assert self.assertTrue(it_is) def test_is_not_path(self): # Arrange - integer = 123 + filename = self.tempfile("temp.ext") + fp = open(filename, 'w').close() # Act - it_is_not = _util.isPath(integer) + it_is_not = _util.isPath(fp) # Assert self.assertFalse(it_is_not)