Skip to content

Instantly share code, notes, and snippets.

@walkoncross
Forked from k0emt/Experiment.py
Created November 29, 2016 22:38
Show Gist options
  • Select an option

  • Save walkoncross/9a23ee96f157ae93da63918bdb1c891b to your computer and use it in GitHub Desktop.

Select an option

Save walkoncross/9a23ee96f157ae93da63918bdb1c891b to your computer and use it in GitHub Desktop.
Basic Hello world in Python with corresponding unittest
__author__ = 'k0emt'
class Greeter:
def __init__(self):
self.message = 'Hello world'
# print self.message
__author__ = 'k0emt'
import unittest
from Experiment import Greeter
class MyTestCase(unittest.TestCase):
def test_default_greeting_set(self):
greeter = Greeter()
# this test will fail until you change the Greeter to return this expected message
self.assertEqual(greeter.message, 'Hello world!')
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment