summaryrefslogtreecommitdiff
path: root/src/tests/test_vyos_dict_search.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-28 19:30:11 +0100
committerChristian Poessinger <christian@poessinger.com>2020-10-28 19:30:11 +0100
commit25551c5a30bda8bd6e459638cda252ee4c93a07f (patch)
tree3f630be5993af5f50c2c55a3a2bfe7dff9312028 /src/tests/test_vyos_dict_search.py
parent4a83a9ac55caf463c876dd948445e09d316ca629 (diff)
downloadvyos-1x-25551c5a30bda8bd6e459638cda252ee4c93a07f.tar.gz
vyos-1x-25551c5a30bda8bd6e459638cda252ee4c93a07f.zip
vyos.util: T2995: rename vyos_dict_search() -> dict_search()
Renamed using snippet below: ---------------------------- for file in $(find . -name "*.py") do sed -i "s/vyos_dict_search/dict_search/" $file done
Diffstat (limited to 'src/tests/test_vyos_dict_search.py')
-rw-r--r--src/tests/test_vyos_dict_search.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tests/test_vyos_dict_search.py b/src/tests/test_vyos_dict_search.py
index cba6562da..f12aac64e 100644
--- a/src/tests/test_vyos_dict_search.py
+++ b/src/tests/test_vyos_dict_search.py
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from unittest import TestCase
-from vyos.util import vyos_dict_search
+from vyos.util import dict_search
data = {
'string': 'fooo',
@@ -30,28 +30,28 @@ class TestDictSearch(TestCase):
def test_non_existing_keys(self):
""" TestDictSearch: Return False when querying for non-existent key """
- self.assertFalse(vyos_dict_search('non_existing', data))
+ self.assertFalse(dict_search('non_existing', data))
def test_string(self):
""" TestDictSearch: Return value when querying string """
- self.assertEqual(vyos_dict_search('string', data), data['string'])
+ self.assertEqual(dict_search('string', data), data['string'])
def test_list(self):
""" TestDictSearch: Return list items when querying list """
- self.assertEqual(vyos_dict_search('list', data), data['list'])
+ self.assertEqual(dict_search('list', data), data['list'])
def test_dict_key_value(self):
""" TestDictSearch: Return dictionary keys value when value is present """
- self.assertEqual(vyos_dict_search('dict.key_2', data), data['dict']['key_2'])
+ self.assertEqual(dict_search('dict.key_2', data), data['dict']['key_2'])
def test_nested_dict_key_value(self):
""" TestDictSearch: Return string value of last key when querying for a nested string """
- self.assertEqual(vyos_dict_search('nested.string', data), data['nested']['string'])
+ self.assertEqual(dict_search('nested.string', data), data['nested']['string'])
def test_nested_dict_key_empty(self):
""" TestDictSearch: Return False when querying for a nested string whose last key is empty """
- self.assertFalse(vyos_dict_search('nested.empty', data))
+ self.assertFalse(dict_search('nested.empty', data))
def test_nested_list(self):
""" TestDictSearch: Return list items when querying nested list """
- self.assertEqual(vyos_dict_search('nested.list', data), data['nested']['list'])
+ self.assertEqual(dict_search('nested.list', data), data['nested']['list'])