Skip to content

Instantly share code, notes, and snippets.

@rdammkoehler
Last active May 15, 2017 14:59
Show Gist options
  • Save rdammkoehler/714f4b13b0fce6826c2f1c8ffb245854 to your computer and use it in GitHub Desktop.
Save rdammkoehler/714f4b13b0fce6826c2f1c8ffb245854 to your computer and use it in GitHub Desktop.
Moise Foo.py
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