Updates to examples and documentation.

This commit is contained in:
Rowan Cockett
2015-11-24 22:09:50 -08:00
parent 109340c645
commit 56d5019b94
15 changed files with 201 additions and 41 deletions
+13 -8
View File
@@ -1,17 +1,22 @@
import unittest
import sys
from SimPEG.Examples import Linear, DCfwd
from SimPEG import Examples
import numpy as np
class TestLinear(unittest.TestCase):
def test_running(self):
Linear.run(100, plotIt=False)
def get_test(test):
def func(self):
print '\nTesting %s.run(plotIt=False)\n'%test
getattr(Examples, test).run(plotIt=False)
self.assertTrue(True)
return func
attrs = dict()
tests = [_ for _ in dir(Examples) if not _.startswith('_')]
for test in tests:
attrs['test_'+test] = get_test(test)
TestExamples = type('TestExamples', (unittest.TestCase,), attrs)
class TestDCfwd(unittest.TestCase):
def test_running(self):
DCfwd.run(plotIt=False)
self.assertTrue(True)
if __name__ == '__main__':
unittest.main()