Skip to content

Commit

Permalink
Fixed final unit test.
Browse files Browse the repository at this point in the history
Cleaned up and fixed the final unit test.
It can still be extended to also deal with numbers, etc.
  • Loading branch information
Paul committed May 31, 2017
1 parent ee13e1a commit c74d589
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ex40-49/ex49/tests/parser_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ def test_parse_subject():


def test_parse_sentence():
pass
"""
word_list = scan("eat princess")
sentence = parse_sentence(word_list)

# TODO: Fix this test.
assert_equal(parse_sentence([('verb', 'run')]), [('verb', 'run')])
test_sentence = parse_sentence([('verb', 'run'),
('direction', 'north'),
('error', 'IAS')])
assert_equal(test_sentence, [('verb', 'run'),
('direction', 'north'),
('error', 'IAS')])
"""
assert_equal(sentence.subject, 'player')
assert_equal(sentence.verb, 'eat')
assert_equal(sentence.object, 'princess')

0 comments on commit c74d589

Please sign in to comment.