anki-connect/tests/test_graphical.py

51 lines
1.3 KiB
Python
Raw Normal View History

2018-05-09 01:16:36 +00:00
#!/usr/bin/env python
import unittest
import util
class TestGui(unittest.TestCase):
def runTest(self):
# guiBrowse
util.invoke('guiBrowse', query='deck:Default')
# guiAddCards
util.invoke('guiAddCards')
2019-01-24 07:36:11 +00:00
# guiAddCards with preset
util.invoke('createDeck', deck='test')
note = {'deckName': 'test', 'modelName': 'Basic', 'fields': {'Front': 'front1', 'Back': 'back1'}, 'tags': ['tag1']}
util.invoke('guiAddCards', note=note)
# guiAddCards with preset and closeAfterAdding
noteWithOption = {'deckName': 'test', 'modelName': 'Basic', 'fields': {'Front': 'front1', 'Back': 'back1'}, 'options': { 'closeAfterAdding': True }, 'tags': ['tag1']}
util.invoke('guiAddCards', note=noteWithOption)
2018-05-09 01:16:36 +00:00
# guiCurrentCard
# util.invoke('guiCurrentCard')
# guiStartCardTimer
util.invoke('guiStartCardTimer')
# guiShowQuestion
util.invoke('guiShowQuestion')
# guiShowAnswer
util.invoke('guiShowAnswer')
# guiAnswerCard
util.invoke('guiAnswerCard', ease=1)
# guiDeckOverview
util.invoke('guiDeckOverview', name='Default')
# guiDeckBrowser
util.invoke('guiDeckBrowser')
2018-05-09 01:17:26 +00:00
# guiExitAnki
# util.invoke('guiExitAnki')
2018-05-09 01:16:36 +00:00
if __name__ == '__main__':
unittest.main()