diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-09-23 08:28:47 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-09-23 08:28:47 -0500 |
| commit | 803deabc0d54747aa5ac4a982105a9a971edcb32 (patch) | |
| tree | e0bafeaed02be9410db7bf26de4c2fdf600a9290 /src/tests | |
| parent | 6f4ce1ed5cd57d9b42617871389f68771f0e69e0 (diff) | |
| download | vyos-1x-803deabc0d54747aa5ac4a982105a9a971edcb32.tar.gz vyos-1x-803deabc0d54747aa5ac4a982105a9a971edcb32.zip | |
T7850: add nosetest for util list_strip
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/test_utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tests/test_utils.py b/src/tests/test_utils.py index 5d642f4ea..5c06a4394 100644 --- a/src/tests/test_utils.py +++ b/src/tests/test_utils.py @@ -24,3 +24,15 @@ class TestVyOSUtils(TestCase): def test_sysctl_read(self): from vyos.utils.system import sysctl_read self.assertEqual(sysctl_read('net.ipv4.conf.lo.forwarding'), '1') + + def test_list_strip(self): + from vyos.utils.list import list_strip + + lst = ['a', 'b', 'c', 'd', 'e'] + sub = ['a', 'b'] + rsb = ['d', 'e'] + non = ['a', 'e'] + self.assertEqual(list_strip(lst, sub), ['c', 'd', 'e']) + self.assertEqual(list_strip(lst, rsb, right=True), ['a', 'b', 'c']) + self.assertEqual(list_strip(lst, non), []) + self.assertEqual(list_strip(sub, lst), []) |
