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')
|
|
|
|
|
2021-12-06 16:59:10 +00:00
|
|
|
# guiSelectedNotes
|
|
|
|
util.invoke('guiSelectedNotes')
|
|
|
|
|
2018-05-09 01:16:36 +00:00
|
|
|
# guiAddCards
|
|
|
|
util.invoke('guiAddCards')
|
|
|
|
|
2019-01-24 07:36:11 +00:00
|
|
|
# guiAddCards with preset
|
|
|
|
util.invoke('createDeck', deck='test')
|
2021-06-21 03:35:09 +00:00
|
|
|
|
|
|
|
note = {
|
|
|
|
'deckName': 'test',
|
|
|
|
'modelName': 'Basic',
|
|
|
|
'fields': {
|
|
|
|
'Front': 'front1',
|
|
|
|
'Back': 'back1'
|
|
|
|
},
|
|
|
|
'tags': ['tag1'],
|
|
|
|
}
|
2019-01-24 07:36:11 +00:00
|
|
|
util.invoke('guiAddCards', note=note)
|
|
|
|
|
|
|
|
# guiAddCards with preset and closeAfterAdding
|
2021-06-21 03:35:09 +00:00
|
|
|
util.invoke('guiAddCards', note={
|
|
|
|
**note,
|
|
|
|
'options': { 'closeAfterAdding': True },
|
|
|
|
})
|
|
|
|
|
|
|
|
util.invoke('guiAddCards', note={
|
|
|
|
**note,
|
|
|
|
'picture': [{
|
|
|
|
'url': 'https://via.placeholder.com/150.png',
|
|
|
|
'filename': 'placeholder.png',
|
|
|
|
'fields': ['Front'],
|
|
|
|
}]
|
|
|
|
})
|
2019-01-24 07:36:11 +00:00
|
|
|
|
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')
|
|
|
|
|
2021-07-14 00:55:22 +00:00
|
|
|
# guiDatabaseCheck
|
|
|
|
util.invoke('guiDatabaseCheck')
|
|
|
|
|
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()
|