Initial commit
This commit is contained in:
25
tests/openec2/utils/test_array.py
Normal file
25
tests/openec2/utils/test_array.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from openec2.utils.array import parse_array_objects, parse_array_plain
|
||||
|
||||
|
||||
def test_array_parsing_keys():
|
||||
params = {
|
||||
"Key.1.a": "1",
|
||||
"Key.1.b": "2",
|
||||
"Key.2.a": "3",
|
||||
"Key.2.b": "4",
|
||||
}
|
||||
parsed = parse_array_objects("Key", params)
|
||||
assert parsed[0]["a"] == "1"
|
||||
assert parsed[0]["b"] == "2"
|
||||
assert parsed[1]["a"] == "3"
|
||||
assert parsed[1]["b"] == "4"
|
||||
|
||||
def test_array_plain_parsing():
|
||||
params = {
|
||||
"Key.1": "1",
|
||||
"Key.2": "2",
|
||||
"Key.3": "3",
|
||||
}
|
||||
parsed = parse_array_plain("Key", params)
|
||||
|
||||
assert parsed == ["1", "2", "3"]
|
||||
Reference in New Issue
Block a user