Created
August 22, 2017 13:21
-
-
Save czeildi/747ed39d276761153b3e5c34e153ac39 to your computer and use it in GitHub Desktop.
python dojo skeleton with unittest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dojo: | |
def __init__(self, input): | |
self.input = input | |
def calculate(self): | |
return 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run tests from terminal with python test-dojo.py | |
import unittest | |
from dojo import Dojo | |
class DojoTest(unittest.TestCase): | |
def test_calculate_dummy(self): | |
d = Dojo("42") | |
self.assertEqual(42, d.calculate()) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment