forked from phuang/ibus-anthy
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import print_function | ||
|
||
from gi import require_version as gi_require_version | ||
gi_require_version('Gdk', '3.0') | ||
from gi.repository import Gdk | ||
|
||
import unittest | ||
|
||
# Need to flush the output against Gtk.main() | ||
def printflush(sentence): | ||
try: | ||
print(sentence, flush=True) | ||
except IOError: | ||
pass | ||
|
||
def printerr(sentence): | ||
try: | ||
print(sentence, flush=True, file=sys.stderr) | ||
except IOError: | ||
pass | ||
|
||
try: | ||
from tap import TAPTestRunner | ||
printflush('## Load tappy') | ||
except ModuleNotFoundError: | ||
try: | ||
from pycotap import TAPTestRunner | ||
from pycotap import LogMode | ||
printflush('## Load pycotap') | ||
except ModuleNotFoundError as err: | ||
printflush('## Ignore tap module: %s' % str(err)) | ||
|
||
@unittest.skipIf(Gdk.Display.open('') == None, 'Display cannot be open.') | ||
class foo(unittest.TestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
pass | ||
|
||
def setUp(self): | ||
pass | ||
|
||
def test_typing(self): | ||
print('Done') | ||
|
||
def main(): | ||
unittest.main() | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters