# 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
"""Tests for coffee_commands."""




class BaseCoffeeCommandTestCase(hypetest.BaseCommandTestCase):

  def setUp(self):
    super(BaseCoffeeCommandTestCase, self).setUp()
    self.test_user = user_pb2.User(user_id='test-user', display_name='Tester')
    self.test_badge = coffee_pb2.Badge(
        id=0, name='Test Badge', description='This is for being a good tester.')
    self.test_data = coffee_pb2.CoffeeData(
        energy=10,
        beans=[
            coffee_pb2.Bean(variety='Robusta', region='Brazil', rarity='rare'),
            coffee_pb2.Bean(
                variety='Arabica', region='Honduras', rarity='common'),
            coffee_pb2.Bean(
                variety='Liberica', region='Nicaragua', rarity='legendary')
        ],
        badges=[self.test_badge.id])
    self.core.coffee._SetCoffeeData(self.test_user, self.test_data)
    # TODO: Figure out how to load badge textproto in third_party.
    self.core.coffee.badges = {self.test_badge.id: self.test_badge}

  def _GetStats(self, user):
    return self.core.coffee.GetCoffeeData(user).statistics



# 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

"""Tests for coffee_commands."""




class BaseCoffeeCommandTestCase(hypetest.BaseCommandTestCase):

  def setUp(self):
    super(BaseCoffeeCommandTestCase, self).setUp()
    self.test_user = user_pb2.User(user_id='test-user', display_name='Tester')
    self.test_badge = coffee_pb2.Badge(
        id=0, name='Test Badge', description='This is for being a good tester.')
    self.test_data = coffee_pb2.CoffeeData(
        energy=10,
        beans=[
            coffee_pb2.Bean(variety='Robusta', region='Brazil', rarity='rare'),
            coffee_pb2.Bean(
                variety='Arabica', region='Honduras', rarity='common'),
            coffee_pb2.Bean(
                variety='Liberica', region='Nicaragua', rarity='legendary')
        ],
        badges=[self.test_badge.id])
    self.core.coffee._SetCoffeeData(self.test_user, self.test_data)
    # TODO: Figure out how to load badge textproto in third_party.
    self.core.coffee.badges = {self.test_badge.id: self.test_badge}

  def _GetStats(self, user):
    return self.core.coffee.GetCoffeeData(user).statistics



@hypetest.ForCommand(coffee_commands.CoffeeBadgeCommand)