-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testsuite: add python unit tests for conf_builtin_get()
Problem: There are no unit tests for the Python interface to flux_conf_builtin_get(). Add some very simple tests.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
############################################################### | ||
# Copyright 2024 Lawrence Livermore National Security, LLC | ||
# (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
# | ||
# This file is part of the Flux resource manager framework. | ||
# For details, see https://github.com/flux-framework. | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0 | ||
############################################################### | ||
|
||
import unittest | ||
|
||
import subflux # noqa: F401 | ||
from flux.conf_builtin import conf_builtin_get | ||
from pycotap import TAPTestRunner | ||
|
||
|
||
class TestConfBuiltin(unittest.TestCase): | ||
|
||
def test_conf_builtin_get(self): | ||
with self.assertRaises(ValueError): | ||
conf_builtin_get("foo") | ||
|
||
with self.assertRaises(ValueError): | ||
conf_builtin_get("confdir", which="badarg") | ||
|
||
self.assertIsNotNone(conf_builtin_get("confdir")) | ||
self.assertIsNotNone(conf_builtin_get("confdir", which="intree")) | ||
self.assertIsNotNone(conf_builtin_get("confdir", which="installed")) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main(testRunner=TAPTestRunner()) |