
import unittest
from api import message, plugin
from plugins import excuses

class TestExcuseSuite(unittest.TestCase):

    def testExcuseMsg(self):
        msg = message.message(body="")
        msg.command = "excuse"

        fullExcuseList = []

        for sorry in excuses.sorryList:
            for excuse in excuses.excuseList:
                fullExcuseList.append('*{} {}*'.format(sorryList[sorry], excuseList[excuse])
        
        result=excuses.onCommand(msg)
        self.assertEqual(type(result), type(msg))
        self.assertEqual(result.body in fullExcuseList, True)


import unittest
from api import message, plugin
from plugins import excuses

class TestExcuseSuite(unittest.TestCase):

    def testExcuseMsg(self):
        msg = message.message(body="")
        msg.command = "excuse"

        excuseList = ["I have an appointment with a robot.", 
        "I was abducted by robots.", 
        "I didn’t know what day it was because I was looking at the Robotic Calendar.",
        "My robot threw up on my source code.", 
        "I need to take my robot for a walk.",
        "I had to get a cybernetic head and couldn't get anything done.",
        "My Robot Assistant blue-screened.",
        "A kernel panic erased my work.",
        "Somebody used up the data limit watching YouTube."]
        sorryList = ["Please excuse me,", "I'm sorry, but", "I hope you forgive me, because"]
        fullExcuseList = []

        for sorry in sorryList:
            for excuse in excuseList:
                fullExcuseList.append('*{} {}*'.format(sorry, excuse))
        
        result=excuses.onCommand(msg)
        print(result.body)
        self.assertEqual(type(result), type(msg))
        self.assertEqual(result.body in fullExcuseList, True)

Fix the unit test :)
Fix the unit test :)

  
  import unittest
  from api import message, plugin
  from plugins import excuses
  
  class TestExcuseSuite(unittest.TestCase):
  
      def testExcuseMsg(self):
          msg = message.message(body="")
          msg.command = "excuse"
  
+         excuseList = ["I have an appointment with a robot.", 
+         "I was abducted by robots.", 
+         "I didn’t know what day it was because I was looking at the Robotic Calendar.",
+         "My robot threw up on my source code.", 
+         "I need to take my robot for a walk.",
+         "I had to get a cybernetic head and couldn't get anything done.",
+         "My Robot Assistant blue-screened.",
+         "A kernel panic erased my work.",
+         "Somebody used up the data limit watching YouTube."]
+         sorryList = ["Please excuse me,", "I'm sorry, but", "I hope you forgive me, because"]
          fullExcuseList = []
  
-         for sorry in excuses.sorryList:
+         for sorry in sorryList:
-             for excuse in excuses.excuseList:
+             for excuse in excuseList:
-                 fullExcuseList.append('*{} {}*'.format(sorryList[sorry], excuseList[excuse])
+                 fullExcuseList.append('*{} {}*'.format(sorry, excuse))
          
          result=excuses.onCommand(msg)
+         print(result.body)
          self.assertEqual(type(result), type(msg))
          self.assertEqual(result.body in fullExcuseList, True)
  
Fix the unit test :)
## Code Before:

import unittest
from api import message, plugin
from plugins import excuses

class TestExcuseSuite(unittest.TestCase):

    def testExcuseMsg(self):
        msg = message.message(body="")
        msg.command = "excuse"

        fullExcuseList = []

        for sorry in excuses.sorryList:
            for excuse in excuses.excuseList:
                fullExcuseList.append('*{} {}*'.format(sorryList[sorry], excuseList[excuse])
        
        result=excuses.onCommand(msg)
        self.assertEqual(type(result), type(msg))
        self.assertEqual(result.body in fullExcuseList, True)

## Instruction:
Fix the unit test :)
## Code After:

import unittest
from api import message, plugin
from plugins import excuses

class TestExcuseSuite(unittest.TestCase):

    def testExcuseMsg(self):
        msg = message.message(body="")
        msg.command = "excuse"

        excuseList = ["I have an appointment with a robot.", 
        "I was abducted by robots.", 
        "I didn’t know what day it was because I was looking at the Robotic Calendar.",
        "My robot threw up on my source code.", 
        "I need to take my robot for a walk.",
        "I had to get a cybernetic head and couldn't get anything done.",
        "My Robot Assistant blue-screened.",
        "A kernel panic erased my work.",
        "Somebody used up the data limit watching YouTube."]
        sorryList = ["Please excuse me,", "I'm sorry, but", "I hope you forgive me, because"]
        fullExcuseList = []

        for sorry in sorryList:
            for excuse in excuseList:
                fullExcuseList.append('*{} {}*'.format(sorry, excuse))
        
        result=excuses.onCommand(msg)
        print(result.body)
        self.assertEqual(type(result), type(msg))
        self.assertEqual(result.body in fullExcuseList, True)
