Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created January 10, 2020 07:54
Show Gist options
  • Save uncoded-ro/f0f40bf6c4a0b491fdd46388952bf4fd to your computer and use it in GitHub Desktop.
Save uncoded-ro/f0f40bf6c4a0b491fdd46388952bf4fd to your computer and use it in GitHub Desktop.
import unittest
import hello
class TestHello(unittest.TestCase):
def test_hello_python(self):
self.assertEqual(hello.hello_python(), "Hello Python!")
def test_hello_name(self):
self.assertEqual(hello.hello_name(), "Hello Ghita!")
self.assertEqual(hello.hello_name("Marian"), "Hello Marian!")
self.assertRaises(ValueError, hello.hello_name, "M")
with self.assertRaises(ValueError):
hello.hello_name("M")
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment