From 2eb0d3a8948215da5625aae7eda0ca4f6d8d810e Mon Sep 17 00:00:00 2001 From: Dean Malmgren Date: Mon, 6 Apr 2015 08:31:07 -0500 Subject: [PATCH] added some tests for fringe cases of unicode sandwich --- tests/test_placeholder.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_placeholder.py b/tests/test_placeholder.py index c8171e40..904b3c9f 100644 --- a/tests/test_placeholder.py +++ b/tests/test_placeholder.py @@ -33,3 +33,19 @@ def test_fancy_gmail_john(self): 'My email is {{EMAIL}}', 'john AT gmail.com is not replaced with {{EMAIL}}', ) + + def test_empty(self): + """Make sure this returns an empty string""" + self.assertEqual( + scrubadub.clean_with_placeholders(''), + '', + 'empty string is not preserved', + ) + + def test_unicode(self): + """Make sure unicode works, too""" + self.assertEqual( + scrubadub.clean_with_placeholders(u'John is a cat'), + '{{NAME}} is a cat', + 'unicode strings work too', + )