-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_project2.py
More file actions
21 lines (16 loc) · 854 Bytes
/
Copy pathtest_project2.py
File metadata and controls
21 lines (16 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import project2
def test_rev_array():
assert project2.create_rev_array('soupdouppladouup') == 'puuodalppuodpuos'
assert project2.create_rev_array('racecar') == 'racecar'
assert project2.create_rev_array('') == ('')
def test_smoosh_array():
assert project2.create_smoosh_array('soupdouppladouup') == 'spouuupoddoaulppppluaoddopuuuops'
assert project2.create_smoosh_array('racecar') == 'rraacceeccaarr'
assert project2.create_smoosh_array('') == ''
def test_decoded_array():
assert project2.create_decoded_array('spouuupoddoaulppppluaoddopuuuops') == 'soupdouppladouup'
assert project2.create_decoded_array('rraacceeccaarr') == 'racecar'
assert project2.create_decoded_array('') == ''
def test_all_together():
s = "".join(['how', 'to', 'train', 'your', 'dragon'])
assert project2.create_decoded_array(project2.create_smoosh_array(s)) == s