Beispiel #1
0
 def test_surface_energies(self):
     for pot, par, mats in tests:
         test_surface_energies(mats, pot, par, nx, vacuum, test=self)
Beispiel #2
0
###

class TestSurfaceEnergies(unittest.TestCase):

    def test_surface_energies(self):
        for pot, par, mats in tests:
            test_surface_energies(mats, pot, par, nx, vacuum, test=self)

###

if __name__ == '__main__':
    for pot, par, mats in tests:
        if len(sys.argv) > 1:
            found = False
            if par is not None:
                for keyword in sys.argv[1:]:
                    if '__ref__' in par:
                        if par['__ref__'].lower().find(keyword.lower()) != -1:
                            found = True
            try:
                potname = pot.__name__
            except:
                potname = pot.__class__.__name__
            for keyword in sys.argv[1:]:
                if potname.lower().find(keyword.lower()) != -1:
                    found = True
            if not found:
                continue

        test_surface_energies(mats, pot, par, nx, vacuum, dump=True)