Money, Rate, CentCount and a bunch of bugfixes.
[python_utils.git] / tests / string_utils_test.py
index 0472daaccaf9a525794df24e79c8ae5f923898f0..cc570364047382c3d0e2aee570674cc37e87c710 100755 (executable)
@@ -180,6 +180,12 @@ class TestStringUtils(unittest.TestCase):
         self.assertFalse(su.is_snake_case('thisIsATest'))
         self.assertTrue(su.is_snake_case('this_is_a_test'))
 
+    def test_sprintf_context(self):
+        with su.SprintfStdout() as buf:
+            print("This is a test.")
+            print("This is another one.")
+        self.assertEqual('This is a test.\nThis is another one.\n', buf())
+
 
 if __name__ == '__main__':
     bootstrap.initialize(unittest.main)()