Framework for testing

This commit is contained in:
Kovid Goyal
2016-10-16 20:36:27 +05:30
parent a24c6ad991
commit adaf748852
4 changed files with 140 additions and 3 deletions

20
kitty_tests/__init__.py Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from unittest import TestCase
class BaseTest(TestCase):
ae = TestCase.assertEqual
def set_text_in_line(line, text, offset=0):
pos = offset
for ch in text:
line.char[pos] = ord(ch)
line.width[pos] = 1
pos += 1
if pos >= len(line):
break