Add initial tests

This commit is contained in:
DSTO\pivatom
2018-12-18 10:11:40 +10:30
parent 79ac305b90
commit 174e4fdf94
3 changed files with 60 additions and 0 deletions

26
tests/test_vote.py Normal file
View File

@@ -0,0 +1,26 @@
import unittest
from DecisionSystem.vote import Vote
# Need to subclass unittest.TestCase to be a test case.
class Test_TestVoteMethods(unittest.TestCase):
# Test method dec. must start with test
def test_vote_default(self):
self.assertIs(self.vote.vote, None)
def test_vote_set(self):
self.vote.vote = "Hello"
self.assertEqual(self.vote.vote, "Hello")
def test_equal_default(self):
self.assertEqual(self.vote, Vote())
def test_equal_changed(self):
self.vote.vote = "Hi"
self.assertEqual(self.vote, Vote("Hi"))
def setUp(self):
self.vote = Vote()
if __name__ == '__main__':
unittest.main()