Skip to content

Update tests for Bob. #2167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/GENERATOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ creating test files from the canonical data.
## Script Usage

Test generation requires a local copy of the [problem-specifications] repository.
The script should be run from the root `python` directory, in order to correctly
access the exercises.

Run `bin/generate_tests.py --help` for usage information.

Expand Down
11 changes: 5 additions & 6 deletions exercises/bob/bob_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from bob import response

# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.6.0


class BobTest(unittest.TestCase):
Expand All @@ -27,17 +27,16 @@ def test_asking_gibberish(self):
self.assertEqual(response("fffbbcbeab?"), "Sure.")

def test_talking_forcefully(self):
self.assertEqual(response("Let's go make out behind the gym!"), "Whatever.")
self.assertEqual(response("Hi there!"), "Whatever.")

def test_using_acronyms_in_regular_speech(self):
self.assertEqual(
response("It's OK if you don't want to go to the DMV."), "Whatever."
response("It's OK if you don't want to go work for NASA."), "Whatever."
)

def test_forceful_question(self):
self.assertEqual(
response("WHAT THE HELL WERE YOU THINKING?"),
"Calm down, I know what I'm doing!",
response("WHAT'S GOING ON?"), "Calm down, I know what I'm doing!"
)

def test_shouting_numbers(self):
Expand All @@ -56,7 +55,7 @@ def test_shouting_with_special_characters(self):
)

def test_shouting_with_no_exclamation_mark(self):
self.assertEqual(response("I HATE THE DMV"), "Whoa, chill out!")
self.assertEqual(response("I HATE THE DENTIST"), "Whoa, chill out!")

def test_statement_containing_question_mark(self):
self.assertEqual(response("Ending with ? means a question."), "Whatever.")
Expand Down