cleanup deck tests
This commit is contained in:
parent
a7a03ab1b9
commit
4c86400d32
@ -4,37 +4,30 @@ import unittest
|
|||||||
import util
|
import util
|
||||||
|
|
||||||
|
|
||||||
class TestDeckNames(unittest.TestCase):
|
class TestDecks(unittest.TestCase):
|
||||||
def runTest(self):
|
def runTest(self):
|
||||||
result = util.invoke('deckNames')
|
# deckNames (part 1)
|
||||||
self.assertIn('Default', result)
|
deckNames = util.invoke('deckNames')
|
||||||
|
self.assertIn('Default', deckNames)
|
||||||
|
|
||||||
|
# deckNamesAndIds
|
||||||
class TestDeckNamesAndIds(unittest.TestCase):
|
|
||||||
def runTest(self):
|
|
||||||
result = util.invoke('deckNamesAndIds')
|
result = util.invoke('deckNamesAndIds')
|
||||||
self.assertIn('Default', result)
|
self.assertIn('Default', result)
|
||||||
self.assertEqual(result['Default'], 1)
|
self.assertEqual(result['Default'], 1)
|
||||||
|
|
||||||
|
# createDeck
|
||||||
class TestCreateDeck(unittest.TestCase):
|
|
||||||
def tearDown(self):
|
|
||||||
util.invoke('deleteDecks', decks=['test'])
|
|
||||||
|
|
||||||
|
|
||||||
def runTest(self):
|
|
||||||
util.invoke('createDeck', deck='test')
|
|
||||||
self.assertIn('test', util.invoke('deckNames'))
|
|
||||||
|
|
||||||
|
|
||||||
class TestDeleteDecks(unittest.TestCase):
|
|
||||||
def setUp(self):
|
|
||||||
util.invoke('createDeck', deck='test')
|
util.invoke('createDeck', deck='test')
|
||||||
|
|
||||||
|
# deckNames (part 2)
|
||||||
|
deckNames = util.invoke('deckNames')
|
||||||
|
self.assertIn('test', deckNames)
|
||||||
|
|
||||||
def runTest(self):
|
# deleteDecks
|
||||||
util.invoke('deleteDecks', decks=['test'])
|
util.invoke('deleteDecks', decks=['test'])
|
||||||
self.assertNotIn('test', util.invoke('deckNames'))
|
|
||||||
|
# deckNames (part 3)
|
||||||
|
deckNames = util.invoke('deckNames')
|
||||||
|
self.assertNotIn('test', deckNames)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user