|
1 | 1 | from bill_on_document_created import ( |
2 | | - category_by_topic, |
| 2 | + CATEGORY_BY_TOPIC, |
3 | 3 | get_categories_from_topics, |
4 | 4 | TopicAndCategory, |
5 | 5 | ) |
6 | 6 | from collections import deque |
7 | 7 |
|
8 | 8 |
|
9 | 9 | def test_get_categories_from_topics_empty(): |
10 | | - topic_to_category = category_by_topic() |
| 10 | + topic_to_category = CATEGORY_BY_TOPIC |
11 | 11 | tags = [] |
12 | 12 | topic_and_categories = get_categories_from_topics(tags, topic_to_category) |
13 | | - assert topic_and_categories == deque([]) |
| 13 | + assert topic_and_categories == [] |
14 | 14 |
|
15 | 15 |
|
16 | 16 | def test_get_categories_from_topics_non_existant(): |
17 | | - topic_to_category = category_by_topic() |
| 17 | + topic_to_category = CATEGORY_BY_TOPIC |
18 | 18 | tags = ["This shouldn't be a category"] |
19 | 19 | topic_and_categories = get_categories_from_topics(tags, topic_to_category) |
20 | | - assert topic_and_categories == deque([]) |
| 20 | + assert topic_and_categories == [] |
21 | 21 |
|
22 | 22 |
|
23 | 23 | def test_get_categories_from_topics_works(): |
24 | | - topic_to_category = category_by_topic() |
| 24 | + topic_to_category = CATEGORY_BY_TOPIC |
25 | 25 | tags = [ |
26 | 26 | "Banking and financial institutions regulation", |
27 | 27 | "Soil pollution", |
28 | 28 | ] |
29 | 29 | topic_and_categories = get_categories_from_topics(tags, topic_to_category) |
30 | | - assert topic_and_categories == deque( |
31 | | - [ |
32 | | - TopicAndCategory( |
33 | | - topic="Banking and financial institutions regulation", |
34 | | - category="Commerce", |
35 | | - ), |
36 | | - TopicAndCategory( |
37 | | - topic="Soil pollution", category="Environmental Protection" |
38 | | - ), |
39 | | - ] |
40 | | - ) |
| 30 | + assert topic_and_categories == [ |
| 31 | + TopicAndCategory( |
| 32 | + topic="Banking and financial institutions regulation", |
| 33 | + category="Commerce", |
| 34 | + ), |
| 35 | + TopicAndCategory(topic="Soil pollution", category="Environmental Protection"), |
| 36 | + ] |
0 commit comments