diff options
Diffstat (limited to 'python/mozbuild/mozbuild/test/test_pythonutil.py')
-rw-r--r-- | python/mozbuild/mozbuild/test/test_pythonutil.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/python/mozbuild/mozbuild/test/test_pythonutil.py b/python/mozbuild/mozbuild/test/test_pythonutil.py new file mode 100644 index 0000000000..6ebb5cc46e --- /dev/null +++ b/python/mozbuild/mozbuild/test/test_pythonutil.py @@ -0,0 +1,24 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import os + +from mozunit import main + +from mozbuild.pythonutil import iter_modules_in_path + + +def test_iter_modules_in_path(): + tests_path = os.path.normcase(os.path.dirname(__file__)) + paths = list(iter_modules_in_path(tests_path)) + assert set(paths) == set( + [ + os.path.join(os.path.abspath(tests_path), "__init__.py"), + os.path.join(os.path.abspath(tests_path), "test_pythonutil.py"), + ] + ) + + +if __name__ == "__main__": + main() |