# Path: hypebot/commands/coffee_commands.py
# _RARITY_COLORS = {
#     'uncommon': 'green',
#     'rare': 'cyan',
#     'precious': 'purple',
#     'legendary': 'orange'
# }
# FOUND_NO_BEANS_MESSAGE = 'You couldn\'t find any coffee beans.'
# BEAN_STASH_FULL_MESSAGE = ('You already have too many beans, try drinking some '
#                            'coffee.')
# OUT_OF_ENERGY_MESSAGE = ('You are too tired to spend %d energy finding beans, '
#                          'try drinking some coffee.')
# OUT_OF_COFFEE_MESSAGE = 'You don\'t have any coffee, try finding some beans.'
# UNOWNED_BEAN_MESSAGE = 'You don\'t own any beans with ID "%s".'
# NO_BADGES_MESSAGE = '%s doesn\'t have any badges.'
# def FormatBean(bean_data: coffee_pb2.Bean,
#                uppercase: bool = False,
#                count: int = 1) -> Text:
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               bean_id: Optional[Text] = None):
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               energy: Optional[Text]):
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               target_user: Optional[user_pb2.User] = None):
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               target_user: Optional[user_pb2.User] = None):
# class DrinkCoffeeCommand(command_lib.BaseCommand):
# class FindCoffeeCommand(command_lib.BaseCommand):
# class CoffeeStashCommand(command_lib.BaseCommand):
# class CoffeeBadgeCommand(command_lib.BaseCommand):
# 
# Path: hypebot/commands/hypetest.py
# TEST_CHANNEL = channel_pb2.Channel(
#     id='#test', name='Test', visibility=channel_pb2.Channel.PUBLIC)
# TEST_USER = user_pb2.User(user_id='_test', display_name='user')
#   BOT_PARAMS = params_lib.MergeParams(basebot.BaseBot.DEFAULT_PARAMS, {
#       'interface': {
#           'type': 'CaptureInterface',
#       },
#       'proxy': {
#           # Tests are often run in an environment with no external access, so we
#           # provide a fake Proxy.
#           'type': 'EmptyProxy',
#       },
#       'storage': {
#           'type': 'MemStore',
#           'cached_type': 'MemStore',
#       },
#       'execution_mode': {
#           # This currently sets the command prefix to `!`. We should figure out
#           # a better long-term solution for the command prefix though since this
#           # can in theory change other behavior within core, but currently
#           # should have no other impacts.
#           'dev': False,
#       },
#       'commands': {},
#       'subscriptions': {},
#   })
# def ForCommand(command_cls):
#   def _Internal(test_cls):
#   def setUpClass(cls):
#   def setUp(self):
# class BaseCommandTestCase(unittest.TestCase):


import random
import unittest
from unittest import mock
from hypebot.commands import coffee_commands
from hypebot.commands import hypetest
from hypebot.protos import coffee_pb2
from hypebot.protos import message_pb2
from hypebot.protos import user_pb2
    initial_drink_count = self._GetStats(hypetest.TEST_USER).drink_count
    response = self.command.Handle(hypetest.TEST_CHANNEL, hypetest.TEST_USER,
                                   '!coffee d %s' % bad_id)

    self.assertEqual(response, coffee_commands.UNOWNED_BEAN_MESSAGE % bad_id)
    cur_drink_count = self._GetStats(hypetest.TEST_USER).drink_count
    self.assertEqual(cur_drink_count, initial_drink_count)

  def test_drinking_gives_energy(self):
    initial_energy = self.test_data.energy
    initial_drink_count = self._GetStats(self.test_user).drink_count

    response = self.command.Handle(hypetest.TEST_CHANNEL, self.test_user,
                                   '!coffee drink')

    user_data = self.core.coffee.GetCoffeeData(self.test_user)
    cur_energy = user_data.energy
    self.assertGreater(cur_energy, initial_energy)
    self.assertEqual(user_data.statistics.drink_count, initial_drink_count + 1)
    self.assertRegex(response, r'%d' % (cur_energy - initial_energy))

  def test_drinking_prefix_id_matches_and_consumes(self):
    response = self.command.Handle(hypetest.TEST_CHANNEL, self.test_user,
                                   '!coffee drink cah')

    self.assertRegex(response, 'energy')
    user_beans = self.core.coffee.GetCoffeeData(self.test_user).beans
    self.assertNotIn('cahonduras', [b.id for b in user_beans])



# Path: hypebot/commands/coffee_commands.py
# _RARITY_COLORS = {
#     'uncommon': 'green',
#     'rare': 'cyan',
#     'precious': 'purple',
#     'legendary': 'orange'
# }
# FOUND_NO_BEANS_MESSAGE = 'You couldn\'t find any coffee beans.'
# BEAN_STASH_FULL_MESSAGE = ('You already have too many beans, try drinking some '
#                            'coffee.')
# OUT_OF_ENERGY_MESSAGE = ('You are too tired to spend %d energy finding beans, '
#                          'try drinking some coffee.')
# OUT_OF_COFFEE_MESSAGE = 'You don\'t have any coffee, try finding some beans.'
# UNOWNED_BEAN_MESSAGE = 'You don\'t own any beans with ID "%s".'
# NO_BADGES_MESSAGE = '%s doesn\'t have any badges.'
# def FormatBean(bean_data: coffee_pb2.Bean,
#                uppercase: bool = False,
#                count: int = 1) -> Text:
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               bean_id: Optional[Text] = None):
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               energy: Optional[Text]):
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               target_user: Optional[user_pb2.User] = None):
#   def _Handle(self,
#               channel: channel_pb2.Channel,
#               user: user_pb2.User,
#               target_user: Optional[user_pb2.User] = None):
# class DrinkCoffeeCommand(command_lib.BaseCommand):
# class FindCoffeeCommand(command_lib.BaseCommand):
# class CoffeeStashCommand(command_lib.BaseCommand):
# class CoffeeBadgeCommand(command_lib.BaseCommand):
# 
# Path: hypebot/commands/hypetest.py
# TEST_CHANNEL = channel_pb2.Channel(
#     id='#test', name='Test', visibility=channel_pb2.Channel.PUBLIC)
# TEST_USER = user_pb2.User(user_id='_test', display_name='user')
#   BOT_PARAMS = params_lib.MergeParams(basebot.BaseBot.DEFAULT_PARAMS, {
#       'interface': {
#           'type': 'CaptureInterface',
#       },
#       'proxy': {
#           # Tests are often run in an environment with no external access, so we
#           # provide a fake Proxy.
#           'type': 'EmptyProxy',
#       },
#       'storage': {
#           'type': 'MemStore',
#           'cached_type': 'MemStore',
#       },
#       'execution_mode': {
#           # This currently sets the command prefix to `!`. We should figure out
#           # a better long-term solution for the command prefix though since this
#           # can in theory change other behavior within core, but currently
#           # should have no other impacts.
#           'dev': False,
#       },
#       'commands': {},
#       'subscriptions': {},
#   })
# def ForCommand(command_cls):
#   def _Internal(test_cls):
#   def setUpClass(cls):
#   def setUp(self):
# class BaseCommandTestCase(unittest.TestCase):


# Path: hypebot/commands/coffee_commands_test.py
import random
import unittest
from unittest import mock
from hypebot.commands import coffee_commands
from hypebot.commands import hypetest
from hypebot.protos import coffee_pb2
from hypebot.protos import message_pb2
from hypebot.protos import user_pb2

    initial_drink_count = self._GetStats(hypetest.TEST_USER).drink_count
    response = self.command.Handle(hypetest.TEST_CHANNEL, hypetest.TEST_USER,
                                   '!coffee d %s' % bad_id)

    self.assertEqual(response, coffee_commands.UNOWNED_BEAN_MESSAGE % bad_id)
    cur_drink_count = self._GetStats(hypetest.TEST_USER).drink_count
    self.assertEqual(cur_drink_count, initial_drink_count)

  def test_drinking_gives_energy(self):
    initial_energy = self.test_data.energy
    initial_drink_count = self._GetStats(self.test_user).drink_count

    response = self.command.Handle(hypetest.TEST_CHANNEL, self.test_user,
                                   '!coffee drink')

    user_data = self.core.coffee.GetCoffeeData(self.test_user)
    cur_energy = user_data.energy
    self.assertGreater(cur_energy, initial_energy)
    self.assertEqual(user_data.statistics.drink_count, initial_drink_count + 1)
    self.assertRegex(response, r'%d' % (cur_energy - initial_energy))

  def test_drinking_prefix_id_matches_and_consumes(self):
    response = self.command.Handle(hypetest.TEST_CHANNEL, self.test_user,
                                   '!coffee drink cah')

    self.assertRegex(response, 'energy')
    user_beans = self.core.coffee.GetCoffeeData(self.test_user).beans
    self.assertNotIn('cahonduras', [b.id for b in user_beans])



@hypetest.ForCommand(coffee_commands.FindCoffeeCommand)