-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
27 lines (24 loc) · 868 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pytest
import main
def test_squash():
main.args = main.define_arguments("version")
main.args.delimiter = "*"
# Test that the squash function works
data = [
{"block_tag": "one", "response": "one"},
{"block_tag": "one", "response": "two"},
{"block_tag": "one", "response": "three"},
{"block_tag": "two", "response": "four"},
{"block_tag": "two", "response": "five"},
{"block_tag": "two", "response": "six"},
{"block_tag": "three", "response": "seven"},
{"block_tag": "four", "response": "eight"},
{"block_tag": "four", "response": "nine"},
{"block_tag": "four", "response": "ten"},
]
# assert main.squash(data) == {
# "one": "one*two*three*",
# "two": "four*five*six*",
# "three": "seven*",
# "four": "eight*nine*ten*",
# }