summaryrefslogtreecommitdiff
path: root/ttystatus/status_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-10 21:46:53 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-10 21:46:53 +0100
commitcf3fd3cf62b624b492a8f9cdfc72867ab7305767 (patch)
tree0e9aff68dcc4074cdd6b2996949c997101bc7100 /ttystatus/status_tests.py
parenta0c62a17f539adc4b1a13eec3d3d0f99081a0f33 (diff)
parent13ff05e4518b3892f7ea7ebe495f23a868a29baa (diff)
downloadttystatus-cf3fd3cf62b624b492a8f9cdfc72867ab7305767.tar.gz
Merge: Python 3 support
Diffstat (limited to 'ttystatus/status_tests.py')
-rw-r--r--ttystatus/status_tests.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/ttystatus/status_tests.py b/ttystatus/status_tests.py
index 92425ac..5b8cd09 100644
--- a/ttystatus/status_tests.py
+++ b/ttystatus/status_tests.py
@@ -14,12 +14,18 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import StringIO
+import io as StringIO
import unittest
import ttystatus
+if 'unicode' in __builtins__:
+ make_text = __builtins__['unicode']
+else:
+ make_text = str
+
+
class DummyMessager(object):
def __init__(self):
@@ -37,7 +43,7 @@ class DummyMessager(object):
return True
def write(self, string, force=False):
- self.written.write(string)
+ self.written.write(make_text(string))
def notify(self, string, f, force=False):
pass
@@ -130,7 +136,7 @@ class TerminalStatusTests(unittest.TestCase):
def test_enable_calls_messager_enable(self):
self.ts.disable()
self.ts.enable()
- self.assert_(self.ts._m.enabled)
+ self.assertTrue(self.ts._m.enabled)
def test_counts_correctly_even_without_rendering(self):
w = ttystatus.Counter('value')