-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_datastream.py
39 lines (28 loc) · 1.09 KB
/
test_datastream.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
28
29
30
31
32
33
34
35
36
37
38
39
import datastream
example_1 = "mjqjpqmgbljsphdztnvjfqwrcgsmlb"
example_2 = "bvwbjplbgvbhsrlpgdmjqwftvncz"
example_3 = "nppdvjthqldpwncqszvftbrmjlhg"
example_4 = "nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg"
example_5 = "zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw"
def test_start_of_packet():
ds = datastream.Datastream(example_1)
assert ds.start_of_packet() == 7
ds = datastream.Datastream(example_2)
assert ds.start_of_packet() == 5
ds = datastream.Datastream(example_3)
assert ds.start_of_packet() == 6
ds = datastream.Datastream(example_4)
assert ds.start_of_packet() == 10
ds = datastream.Datastream(example_5)
assert ds.start_of_packet() == 11
def test_start_of_message():
ds = datastream.Datastream(example_1)
assert ds.start_of_message() == 19
ds = datastream.Datastream(example_2)
assert ds.start_of_message() == 23
ds = datastream.Datastream(example_3)
assert ds.start_of_message() == 23
ds = datastream.Datastream(example_4)
assert ds.start_of_message() == 29
ds = datastream.Datastream(example_5)
assert ds.start_of_message() == 26