class_docstr: Unit tests for the BestMatch logic adapter.
class_docstr_tok: ["Unit","tests","for","the","BestMatch","logic","adapter","."]
docstr: A match can be selected which has no known responses.
  In this case a random response will be returned, but the confidence
  should be zero because it is a random choice.
docstr_tok: ["A","match","can","be","selected","which","has","no","known","responses",".","In","this","case","a","random","response","will","be","returned",",","but","the","confidence","should","be","zero","because","it","is","a","random","choice","."]
code: def test_no_known_responses(self):
      """
      A match can be selected which has no known responses.
      In this case a random response will be returned, but the confidence
      should be zero because it is a random choice.
      """
      from unittest.mock import MagicMock
  
      self.chatbot.storage.update = MagicMock()
      self.chatbot.storage.count = MagicMock(return_value=1)
      self.chatbot.storage.get_random = MagicMock(
          return_value=Statement(text="Random")
      )
  
      match = self.adapter.process(Statement(text="Blah"))
  
      self.assertEqual(match.confidence, 0)
      self.assertEqual(match.text, "Random")
  
file_path: ChatterBot/tests/logic/test_best_match.py
imports: from chatterbot.logic import BestMatch
  from chatterbot.conversation import Statement
  from tests.base_case import ChatBotTestCase
label_desc: Use image node_id 4 for calling the BestMatchTestCase obj's underlying member method code with example usage: obj.test_no_known_responses() without return types