Skip to content

Commit

Permalink
test7
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwarat committed Jan 30, 2024
1 parent 681f71f commit d5578c5
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions tests/foo.py
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()
2 changes: 1 addition & 1 deletion tests/test-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ run_test_suite()
echo "#### Starting Python$i API test $RUN_ARGS";
env IBUS_ANTHY_ENGINE_PATH=$SRCDIR/../engine/python$i \
IBUS_ANTHY_SETUP_PATH=$SRCDIR/../setup/python$i \
python$i -u $SRCDIR/anthytest.py $RUN_ARGS;
python$i -u $SRCDIR/foo.py $RUN_ARGS;
if test $? -ne 0 ; then
exit -1;
fi;
Expand Down

0 comments on commit d5578c5

Please sign in to comment.