Skip to content

Commit 8a5a770

Browse files
tests: ensure DNSResolverSettings::get_python_script_options correctly obtains available modules #681
1 parent 6e3258c commit 8a5a770

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsDNSResolverSettingsTestCase.inc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,14 @@ class APIModelsDNSResolverSettingsTestCase extends TestCase {
7474
$unbound_config = file_get_contents('/var/unbound/unbound.conf');
7575
$this->assert_str_contains($unbound_config, 'test: test');
7676
}
77+
78+
/**
79+
* Checks that the `get_python_script_options` method correctly retrieves the available Python scripts.
80+
*/
81+
public function test_get_python_script_options(): void {
82+
# Add a mock script to /var/unbound/ to populate an option
83+
touch('/var/unbound/test_option1.py');
84+
$settings = new DNSResolverSettings(async: false);
85+
$this->assert_equals($settings->get_python_script_options(), ['test_option1']);
86+
}
7787
}

0 commit comments

Comments
 (0)