Skip to content

Commit

Permalink
Merge pull request #37858 from mantidproject/ewm6854-ornl-next
Browse files Browse the repository at this point in the history
add ConfigService::remove to python API - `ornl-next`
  • Loading branch information
rboston628 authored Aug 22, 2024
2 parents 8bdca46 + 3a32f69 commit fca7b75
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void export_ConfigService() {
"definitions")
.def("getFacilityNames", &ConfigServiceImpl::getFacilityNames, arg("self"), "Returns the default facility")
.def("getFacilities", &ConfigServiceImpl::getFacilities, arg("self"), "Returns the default facility")
.def("remove", &ConfigServiceImpl::remove, (arg("self"), arg("rootName")), "Remove the indicated key.")
.def("getFacility", (const FacilityInfo &(ConfigServiceImpl::*)() const) & ConfigServiceImpl::getFacility,
arg("self"), return_value_policy<reference_existing_object>(), "Returns the default facility")
.def("getFacility",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ def test_contains(self):
# verify check for converting checked value to string
self.assertFalse(1 in ConfigService)

def test_remove(self):
garbage = "garbage.truck"
assert garbage not in list(config.keys())
config.setString(garbage, "yes")
assert garbage in list(config.keys())
config.remove(garbage)
assert garbage not in list(config.keys())

@unittest.skipIf(not _on_windows, "Windows only test, uses APPDATA")
def test_get_app_data_dir(self):
self.assertEqual(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- expose :class:`ConfigService::remove() <mantid.kernel.ConfigServiceImpl.remove>` to python API

0 comments on commit fca7b75

Please sign in to comment.