Last active
May 15, 2017 14:59
-
-
Save rdammkoehler/714f4b13b0fce6826c2f1c8ffb245854 to your computer and use it in GitHub Desktop.
Moise Foo.py
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
from unittest import TestCase | |
import nose.tools as nt | |
def foo(x,y): | |
return (x+y), (x*y) | |
class FooTests_2(TestCase): | |
def __execute_foo(self, x, y): | |
return foo(x, y) | |
def __foo_adds(self, x, y): | |
return self.__execute_foo(x, y)[0] | |
def __foo_multiplies(self, x, y): | |
return self.__execute_foo(x, y)[1] | |
def test_foo_does_add(self): | |
x = 5 | |
y = 5 | |
expect = x + y | |
result = self.__foo_adds(x,y) | |
nt.assert_equals(expect, result) | |
def test_foo_does_multiply(self): | |
x = 5 | |
y = 5 | |
expect = x * y | |
result = self.__foo_multiplies(x,y) | |
nt.assert_equals(expect, result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment