From 29b656f14d8bb7622ff861208d26cf8eb018670d Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Tue, 25 Oct 2022 13:42:30 -0500 Subject: vyos.util: T4773: add camel_to_snake_case conversion --- src/tests/test_util.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/tests/test_util.py') 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') -- cgit v1.2.3