26 lines
680 B
Python
26 lines
680 B
Python
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() |