Created
February 21, 2020 21:25
-
-
Save gandroz/dc00b9de353d8274b270e798dd24be3e to your computer and use it in GitHub Desktop.
gitlab_snippet
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
""" | |
Unit testing of the automatic batch processing application | |
""" | |
import unittest | |
from src.app import squares | |
class AppTests(unittest.TestCase): | |
def test_app(self): | |
"""Simple Tests""" | |
self.assertEqual(squares(10), 100) | |
self.assertNotEqual(squares(2), 5) | |
def test_errors(self): | |
"""Check that method fails when parameter type is not numeric""" | |
with self.assertRaises(TypeError): | |
squares("foo") | |
def suite(): | |
_suite = unittest.TestSuite() | |
_suite.addTest(AppTests('test_app')) | |
_suite.addTest(AppTests('test_errors')) | |
return _suite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment