summaryrefslogtreecommitdiff
path: root/test/test_testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_testing.py')
-rw-r--r--test/test_testing.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/test_testing.py b/test/test_testing.py
index c632f3b5..67eb9456 100644
--- a/test/test_testing.py
+++ b/test/test_testing.py
@@ -1,7 +1,9 @@
+# -*- coding: utf-8 -*-
"""Tests that our test infrastructure is really working!"""
import os, sys
sys.path.insert(0, os.path.split(__file__)[0]) # Force relative import for Py3k
+from coverage.backward import to_bytes
from backunittest import TestCase
from coveragetest import CoverageTest
@@ -130,10 +132,18 @@ class CoverageTestTest(CoverageTest):
self.make_file("mac.txt", "Hello\n", newline="\r")
self.assertEqual(self.file_text("mac.txt"), "Hello\r")
+ def test_make_file_non_ascii(self):
+ self.make_file("unicode.txt", "tabblo: «ταБЬℓσ»")
+ self.assertEqual(
+ open("unicode.txt", "rb").read(),
+ to_bytes("tabblo: «ταБЬℓσ»")
+ )
+
def test_file_exists(self):
self.make_file("whoville.txt", "We are here!")
self.assert_exists("whoville.txt")
self.assert_doesnt_exist("shadow.txt")
- self.assertRaises(AssertionError, self.assert_doesnt_exist,
- "whoville.txt")
+ self.assertRaises(
+ AssertionError, self.assert_doesnt_exist, "whoville.txt"
+ )
self.assertRaises(AssertionError, self.assert_exists, "shadow.txt")