diff options
author | John Estabrook <jestabro@vyos.io> | 2022-10-25 19:06:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 19:06:19 -0500 |
commit | 2e3e25514004f11d2238793752536fbc43f4bbf4 (patch) | |
tree | 0b0b6237039add86523d801be6a0c191705954f6 /src/tests | |
parent | c0594071c6c1062cc0069377b6666de89a172d0a (diff) | |
parent | 29b656f14d8bb7622ff861208d26cf8eb018670d (diff) | |
download | vyos-1x-2e3e25514004f11d2238793752536fbc43f4bbf4.tar.gz vyos-1x-2e3e25514004f11d2238793752536fbc43f4bbf4.zip |
Merge pull request #1617 from jestabro/camel_to_snake_case
vyos.util: T4773: add camel_to_snake_case conversion
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test_util.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/test_util.py b/src/tests/test_util.py index 8ac9a500a..d8b2b7940 100644 --- a/src/tests/test_util.py +++ b/src/tests/test_util.py @@ -26,3 +26,17 @@ class TestVyOSUtil(TestCase): def test_sysctl_read(self): self.assertEqual(sysctl_read('net.ipv4.conf.lo.forwarding'), '1') + + def test_camel_to_snake_case(self): + self.assertEqual(camel_to_snake_case('ConnectionTimeout'), + 'connection_timeout') + self.assertEqual(camel_to_snake_case('connectionTimeout'), + 'connection_timeout') + self.assertEqual(camel_to_snake_case('TCPConnectionTimeout'), + 'tcp_connection_timeout') + self.assertEqual(camel_to_snake_case('TCPPort'), + 'tcp_port') + self.assertEqual(camel_to_snake_case('UseHTTPProxy'), + 'use_http_proxy') + self.assertEqual(camel_to_snake_case('CustomerID'), + 'customer_id') |