Skip to content

Commit

Permalink
First work on pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
rwalkerlewis committed Jul 31, 2023
1 parent 307f610 commit 3b62f89
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/pytests/sources/TestPointForce.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env nemesis
#
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2022 University of California, Davis
#
# See LICENSE.md for license information.
#
# ======================================================================
#
# @file tests/pytests/sources/TestPointForce.py
#
# @brief Unit testing of Python TestPointForce object.

import unittest

from pylith.testing.UnitTestApp import TestComponent
from pylith.sources.Source import (PointForce, source)


class TestPointForce(TestComponent):
"""Unit testing of Elasticity object.
"""
_class = PointForce
_factory = source


if __name__ == "__main__":
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPointForce))
unittest.TextTestRunner(verbosity=2).run(suite)


# End of file
40 changes: 40 additions & 0 deletions tests/pytests/sources/TestSource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env nemesis
#
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2022 University of California, Davis
#
# See LICENSE.md for license information.
#
# ======================================================================
#
# @file tests/pytests/sources/TestSource.py
#
# @brief Unit testing of Python TestSource object.

import unittest

from pylith.testing.UnitTestApp import TestAbstractComponent
from pylith.sources.Source import Source


class TestSource(TestAbstractComponent):
"""Unit testing of Source object.
"""
_class = Source


if __name__ == "__main__":
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestSource))
unittest.TextTestRunner(verbosity=2).run(suite)


# End of file
41 changes: 41 additions & 0 deletions tests/pytests/sources/TestWellboreSource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env nemesis
#
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2022 University of California, Davis
#
# See LICENSE.md for license information.
#
# ======================================================================
#
# @file tests/pytests/sources/TestWellboreSource.py
#
# @brief Unit testing of Python TestWellboreSource object.

import unittest

from pylith.testing.UnitTestApp import TestComponent
from pylith.sources.Source import (WellboreSource, source)


class TestWellboreSource(TestComponent):
"""Unit testing of Elasticity object.
"""
_class = WellboreSource
_factory = source


if __name__ == "__main__":
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestWellboreSource))
unittest.TextTestRunner(verbosity=2).run(suite)


# End of file
2 changes: 2 additions & 0 deletions tests/pytests/sources/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .TestSource import TestSource
from .TestWellboreSource import TestWellboreSource

0 comments on commit 3b62f89

Please sign in to comment.