Floritec / py-twitter-bot

0 stars 0 forks source link

The bot should be able to do simple math #2

Open swt2public opened 7 years ago

swt2public commented 7 years ago

Given a tweet "1+1", Then the bot's answer should contain "2".

Hints

  1. You got a feature request! Implement a test that reproduces this requirement
    • On your machine, open test.py in the IDLE
    • This is what the test could look like:
      def test_math1(self):
      response = reply({'text': '1+1', 'user': {'screen_name': 'TestUser'}})
      self.assertTrue("2" in response)
    • Make sure to have from tweet_text import idle_text, reply at the top of the file
  2. Run the test file locally
    • You should get a report with one failing test
  3. Implement the feature in your tweet_text.py
    • To get started, what is the easiest solution you can think of?
  4. When the test passes, commit and push your changes

Expected response containing "2",
but got None

swt2public commented 7 years ago

Given a tweet "1+1", Then the bot's answer should contain "2".

Hints

  1. You got a feature request! Implement a test that reproduces this requirement
    • On your machine, open test.py in the IDLE
    • This is what the test could look like:
      def test_math1(self):
      response = reply({'text': '1+1', 'user': {'screen_name': 'TestUser'}})
      self.assertTrue("2" in response)
    • Make sure to have from tweet_text import idle_text, reply at the top of the file
  2. Run the test file locally
    • You should get a report with one failing test
  3. Implement the feature in your tweet_text.py
    • To get started, what is the easiest solution you can think of?
  4. When the test passes, commit and push your changes

Expected response containing "2",
but got None