diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-10-18 02:38:41 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-10-18 02:38:41 -0400 |
commit | 91295c22eff10201049e4fb926680b3db9e11dde (patch) | |
tree | 7eadb4be2dd30ba35e58bda6614c03880a7cc6ed /t/basic_test.py | |
parent | 5ab52ce39d2f89d6aa7bdec1248c4ceafd9c7893 (diff) | |
download | libvt100-python-91295c22eff10201049e4fb926680b3db9e11dde.tar.gz libvt100-python-91295c22eff10201049e4fb926680b3db9e11dde.zip |
start adding tests
Diffstat (limited to 't/basic_test.py')
-rw-r--r-- | t/basic_test.py | 15 |
1 files changed, 15 insertions, 0 deletions
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() |