anki-connect/tests/test_decks.py

42 lines
948 B
Python
Raw Normal View History

2018-05-07 05:13:21 +00:00
#!/usr/bin/env python
import unittest
import util
class TestDeckNames(unittest.TestCase):
def runTest(self):
result = util.invoke('deckNames')
self.assertIn('Default', result)
class TestDeckNamesAndIds(unittest.TestCase):
def runTest(self):
result = util.invoke('deckNamesAndIds')
self.assertIn('Default', result)
self.assertEqual(result['Default'], 1)
2018-05-07 21:18:20 +00:00
class TestCreateDeck(unittest.TestCase):
def tearDown(self):
2018-05-07 21:34:41 +00:00
util.invoke('deleteDecks', decks=['test'])
2018-05-07 21:18:20 +00:00
def runTest(self):
2018-05-07 21:34:41 +00:00
util.invoke('createDeck', deck='test')
2018-05-07 21:18:20 +00:00
self.assertIn('test', util.invoke('deckNames'))
class TestDeleteDecks(unittest.TestCase):
def setUp(self):
2018-05-07 21:34:41 +00:00
util.invoke('createDeck', deck='test')
2018-05-07 21:18:20 +00:00
def runTest(self):
2018-05-07 21:34:41 +00:00
util.invoke('deleteDecks', decks=['test'])
2018-05-07 21:18:20 +00:00
self.assertNotIn('test', util.invoke('deckNames'))
2018-05-07 05:13:21 +00:00
if __name__ == '__main__':
unittest.main()