Skip to content

Commit

Permalink
Looks like the number should be part of the regex
Browse files Browse the repository at this point in the history
The doctests in questions.py for `extract_questions_from_text` expects
the number to be part of the intro.
  • Loading branch information
delenamalan committed Mar 25, 2020
1 parent 326bb9d commit 48aafe0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_extract_questions_from_text_old_format(self):
assert_equal(1, len(questions))
assert_equal('Ms D Kohler', questions[0]['askedby'])
assert_equal('Minister of Police', questions[0]['questionto'])
assert_equal('Ms D Kohler (DA) to ask the Minister of Police:', questions[0]['intro'])
assert_equal('126. Ms D Kohler (DA) to ask the Minister of Police:', questions[0]['intro'])
assert_equal('With reference to the reply to question 228 on 18 March 2014, (a) how much discontinued ammunition is still in circulation in the SA Police Service in each province and (b) what action is to be taken to remove this ammunition from use?', questions[0]['question'])

def test_extract_questions_from_text_old_format_without_number_before_asker_name(self):
Expand All @@ -72,6 +72,6 @@ def test_extract_questions_from_text_new_format(self):
questions = self.scraper.extract_questions_from_text(text)
assert_equal(1, len(questions))
assert_equal('Ms S J Graham', questions[0]['askedby'])
assert_equal('Ms S J Graham (DA) asked the Minister of Public Works and Infrastructure:', questions[0]['intro'])
assert_equal('104. Ms S J Graham (DA) asked the Minister of Public Works and Infrastructure:', questions[0]['intro'])
assert_equal('Minister of Public Works and Infrastructure', questions[0]['questionto'])
assert_equal('What is the number of residential properties owned by her department in the Lephalale Local Municipality which are vacant?', questions[0]['question'])

0 comments on commit 48aafe0

Please sign in to comment.