diff --git a/Examples/PythonPackageExample/samplepackage/helpers.py b/Examples/PythonPackageExample/samplepackage/helpers.py index ab25d44e41..f480e72aec 100644 --- a/Examples/PythonPackageExample/samplepackage/helpers.py +++ b/Examples/PythonPackageExample/samplepackage/helpers.py @@ -1,3 +1,7 @@ # this is a list of thoughts which is used by the thinker -thoughts = ["itk", "genious", "core", "blue", "vtk", "grand", "berry", "delicious"] +thoughts = ["itk", "genius", "core", "blue", + "vtk", "grand", "berry", "delicious"] + +# it is only in a separate file to show how to +# import other modules in thinker.py diff --git a/Examples/PythonPackageExample/samplepackage/tests/test_advanced.py b/Examples/PythonPackageExample/samplepackage/tests/test_advanced.py index f0912a5167..322e587c16 100644 --- a/Examples/PythonPackageExample/samplepackage/tests/test_advanced.py +++ b/Examples/PythonPackageExample/samplepackage/tests/test_advanced.py @@ -1,35 +1,35 @@ # -*- coding: utf-8 -*- import unittest -from sample.thinker import Thinker +from samplepackage.thinker import Thinker class AdvancedTestSuite(unittest.TestCase): """Advanced test cases.""" def setUp(self): # like in JUnit/CppUnit we can define setUp and tearDown methods # create a thinker with 5 thoughts: self.nr_thoughts = 5 self.thinker = Thinker(self.nr_thoughts) def test_thoughts(self): """ test if the correct number of thoughts is produced :return: """ self.assertEquals(self.nr_thoughts, len(self.thinker.think()), "correct number of thoughts is produced") def test_constructor(self): """ test if trying to construct a thinker without argument raises an error :return: """ with self.assertRaises(TypeError): Thinker() if __name__ == '__main__': unittest.main() diff --git a/Examples/PythonPackageExample/setup.py b/Examples/PythonPackageExample/setup.py index 65a6fcdc89..f81e2a9bf8 100755 --- a/Examples/PythonPackageExample/setup.py +++ b/Examples/PythonPackageExample/setup.py @@ -1,30 +1,30 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='sample', version='0.0.2', description='Sample package adapted from Python-Guide.org for MITK', long_description=readme, # if you want, put your own name here # (this would likely result in people sending you emails) author='MBI@DKFZ', author_email='mitk-users@lists.sourceforge.net', url='http://mitk.org', license=license, - packages=find_packages(exclude=('tests', 'docs', 'tutorials')), + packages=find_packages(exclude=('tests', 'doc', 'tutorials')), # the requirements to install this project. # Since this one is so simple this is empty. install_requires=[] # a more sophisticated project might have something like: #install_requires=['numpy>=1.11.0', 'scipy>=0.17', 'scikit-learn'] )