diff --git a/.gitignore b/.gitignore index 28b111e..5075eef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,90 +1,97 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class *.vpp.lck .pytest_cache/ *.vpp.bak_* python_tests_xml # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg .idea/ # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *,cover .hypothesis/ # Translations *.mo *.pot # Django stuff: *.log # Sphinx documentation docs/_build/ doc/ # PyBuilder target/ #Ipython Notebook .ipynb_checkpoints #Pycharm files *.iml # merging stuff *.orig *~ # Paths in repository mcml.py # images etc *.tif *.nrrd *.caffemodel # C++ stuff build* *.user +hyppopy/tests/test_snipped_000.py +hyppopy/tests/test_snipped_001.py +hyppopy/tests/test_snipped_002.py +hyppopy/tests/test_snipped_003.py +hyppopy/tests/test_snipped_004.py +hyppopy/tests/test_snipped_005.py +hyppopy/tests/test_snipped_006.py diff --git a/hyppopy/tests/__init__.py b/hyppopy/tests/__init__.py index fff4474..8f5ccae 100644 --- a/hyppopy/tests/__init__.py +++ b/hyppopy/tests/__init__.py @@ -1,49 +1,46 @@ import os from hyppopy.globals import ROOT def create_readmesnippeds(): fname = os.path.join(ROOT, "README.md") f = open(fname, "r") codes = [] snipped = None for line in f.readlines(): if snipped is not None: snipped.append("\t\t{}".format(line)) if line.startswith("```"): if line.startswith("```python"): snipped = [] else: if snipped is not None: snipped.pop(-1) codes.append(snipped) snipped = None - - - for n, snipped in enumerate(codes): f = open(os.path.join(ROOT, *("hyppopy", "tests", "test_snipped_{}.py".format(str(n).zfill(3)))), "w") test_code = "# DKFZ\n" test_code += "#\n" test_code += "#\n" test_code += "# Copyright (c) German Cancer Research Center,\n" test_code += "# Division of Medical Image Computing.\n" test_code += "# All rights reserved.\n" test_code += "#\n" test_code += "# This software is distributed WITHOUT ANY WARRANTY; without\n" test_code += "# even the implied warranty of MERCHANTABILITY or FITNESS FOR\n" test_code += "# A PARTICULAR PURPOSE.\n" test_code += "#\n" test_code += "# See LICENSE\n\n" test_code += "import os\n" test_code += "import unittest\n\n" test_code += "class ReadmeSnipped_{}TestSuite(unittest.TestCase):\n\n".format(str(n).zfill(3)) test_code += "\tdef test_scripts(self):\n\n" snipped.insert(0, test_code) - snipped.append("\t\tself.assertTrue(True)\n") f.writelines(snipped) f.close() + create_readmesnippeds() diff --git a/hyppopy/tests/test_READMEScripts.py b/hyppopy/tests/test_READMEScripts.py deleted file mode 100644 index e22e4b9..0000000 --- a/hyppopy/tests/test_READMEScripts.py +++ /dev/null @@ -1,31 +0,0 @@ -# DKFZ -# -# -# Copyright (c) German Cancer Research Center, -# Division of Medical Image Computing. -# All rights reserved. -# -# This software is distributed WITHOUT ANY WARRANTY; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. -# -# See LICENSE - -import os -import unittest - - -class RandomsearchTestSuite(unittest.TestCase): - - def setUp(self): - pass - - def test_scripts(self): - self.assertTrue(True) - - def tearDown(self): - pass - - - -