Fixed issue where get_all_keys or _get_occurence choked on strings. (#9)
This commit is contained in:
parent
08967c817b
commit
7513169ab4
2 changed files with 51 additions and 20 deletions
|
|
@ -184,6 +184,25 @@ class TestGetAllKeys(TestCase):
|
|||
"memory": "16 GB",
|
||||
}
|
||||
}
|
||||
self.sample4 = {
|
||||
"values": [
|
||||
{
|
||||
"checks": [
|
||||
{
|
||||
"monitoring_zones": [
|
||||
"mzdfw",
|
||||
"mzfra",
|
||||
"mzhkg",
|
||||
"mziad",
|
||||
"mzlon",
|
||||
"mzord",
|
||||
"mzsyd"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
def test_sample_data1(self):
|
||||
result = get_all_keys(self.sample1)
|
||||
|
|
@ -222,6 +241,16 @@ class TestGetAllKeys(TestCase):
|
|||
for key in keys_to_verify:
|
||||
self.assertIn(key, result)
|
||||
|
||||
def test_sample_data4(self):
|
||||
result = get_all_keys(self.sample4)
|
||||
self.assertEqual(3, len(result))
|
||||
keys_to_verify = [
|
||||
"values",
|
||||
"checks",
|
||||
"monitoring_zones"
|
||||
]
|
||||
for key in keys_to_verify:
|
||||
|
||||
|
||||
class TestGetOccurrence(TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue