From 91295c22eff10201049e4fb926680b3db9e11dde Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 18 Oct 2014 02:38:41 -0400 Subject: start adding tests --- t/basic_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 t/basic_test.py (limited to 't/basic_test.py') diff --git a/t/basic_test.py b/t/basic_test.py new file mode 100644 index 0000000..cf790ba --- /dev/null +++ b/t/basic_test.py @@ -0,0 +1,15 @@ +import unittest + +import vt100 + +class BasicTest(unittest.TestCase): + def test_basic(self): + vt = vt100.vt100(24, 80) + string = b"foo\033[31m\033[32mb\033[3;7;42ma\033[23mr" + vt.process(string) + assert vt.get_string_plaintext(0, 0, 0, 50) == "foobar\n" + assert vt.cell(0, 0).fgcolor().color() is None + assert vt.cell(0, 3).fgcolor().color() == 2 + assert vt.cell(0, 4).fgcolor().color() == 2 + assert vt.cell(0, 4).bgcolor().color() == 2 + assert vt.cell(0, 4).italic() -- cgit v1.2.3-54-g00ecf