Commit 17587098 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added test

parent 6b971f08
...@@ -25,7 +25,7 @@ class TestExperiments(TestCase): ...@@ -25,7 +25,7 @@ class TestExperiments(TestCase):
mpp.clean_data() mpp.clean_data()
class TestBasics(TestExperiments): class TestEllipticBasics(TestExperiments):
def test_git_repo(self): def test_git_repo(self):
self.assertEqual(mpp.check_git_project(), 0) self.assertEqual(mpp.check_git_project(), 0)
...@@ -37,7 +37,7 @@ class TestBasics(TestExperiments): ...@@ -37,7 +37,7 @@ class TestBasics(TestExperiments):
class TestEllipticConvergence(TestExperiments): class TestEllipticConvergence(TestExperiments):
def test_smoothing_experiment(self): def test_smoothing_experiment_benchmark(self):
self.assertTrue(not os.listdir(mpp.PROJECT_PY_DATA_DIR)) self.assertTrue(not os.listdir(mpp.PROJECT_PY_DATA_DIR))
mpp.mute = False mpp.mute = False
kwargs = {'Experiment': 'ConvergenceTest', 'initLevels': '3, 4, 5, 6, 7, 8, 9'} kwargs = {'Experiment': 'ConvergenceTest', 'initLevels': '3, 4, 5, 6, 7, 8, 9'}
...@@ -49,6 +49,27 @@ class TestEllipticConvergence(TestExperiments): ...@@ -49,6 +49,27 @@ class TestEllipticConvergence(TestExperiments):
mpp.save_convergence_table(table_name='Test') mpp.save_convergence_table(table_name='Test')
self.assertEqual(len(os.listdir(mpp.PROJECT_PY_DATA_DIR)), 6) self.assertEqual(len(os.listdir(mpp.PROJECT_PY_DATA_DIR)), 6)
def test_smoothing_experiment_small(self):
mpp.mute = False
kwargs = {'Experiment': 'ConvergenceTest', 'initLevels': '3, 4, 5, 6'}
smoothings = [1.4, 1.8]
for smoothing in smoothings:
kwargs['smoothing'] = smoothing
self.assertEqual(mpp.run(4, config='mlmc_elliptic', kwargs=kwargs), 0)
mpp.show_convergence_table(plot_name='Test')
mpp.save_convergence_table(table_name='Test')
self.assertEqual(len(os.listdir(mpp.PROJECT_PY_DATA_DIR)), 6)
class TestTransportTransport(TestExperiments):
def test_run(self):
epsilons = [0.05, 0.03, 0.01, 0.005]
for epsilon in epsilons:
kwargs = {'epsilon': epsilon}
self.assertEqual(mpp.run(4, config='mlmc_transport', kwargs=kwargs), 0)
def test_file_creation(self):
pass
if __name__ == '__main__': if __name__ == '__main__':
main() main()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment