# Path: mau_mau/subjects.py
# class Player:
#     def __init__(self, name, strategyClass=BasicStrategy):
#         self.name = name
#         self.hand: Hand = Hand()
#         self.strategy = strategyClass(self)
#         self.nextPlayer = None
#         """Will point to next player when players have joined a table"""
# 
#     def __repr__(self):
#         name = self.__class__.__name__
#         return f"{name}('{self.name}', {self.hand})"
# 
#     def __eq__(self, other):
#         return self.name == other.name
# 
#     def play(self, table):
#         self.strategy.play(table)
# 
#     def draw(self, table, amount=1):
#         for _ in range(amount):
#             if not table.stock:
#                 table.replenish_stock()
#             card = table.stock.fetch()
#             self.hand.put(card)
#             log.debug(f"{self.name} <- {card}")
# 
#     def put(self, table, card, strategy):
#         log.debug(f"play {card}")
#         card = self.hand.fetch(card)
#         table.waste.put(table.upcard)
#         table.upcard = card
#         oldRule = table.rule
#         table.rule = table.rules.get_rule(card)
#         table.rule.strategy = strategy
#         table.transfer_punishments(oldRule, table.rule)


from mau_mau.subjects import Player


def test_player_inequality():
    assert Player("John") != Player("Eric")


def test_player_equality():
    assert Player("Terry") == Player("Terry")


def test_players_with_same_name_can_be_different_objects():

# Path: mau_mau/subjects.py
# class Player:
#     def __init__(self, name, strategyClass=BasicStrategy):
#         self.name = name
#         self.hand: Hand = Hand()
#         self.strategy = strategyClass(self)
#         self.nextPlayer = None
#         """Will point to next player when players have joined a table"""
# 
#     def __repr__(self):
#         name = self.__class__.__name__
#         return f"{name}('{self.name}', {self.hand})"
# 
#     def __eq__(self, other):
#         return self.name == other.name
# 
#     def play(self, table):
#         self.strategy.play(table)
# 
#     def draw(self, table, amount=1):
#         for _ in range(amount):
#             if not table.stock:
#                 table.replenish_stock()
#             card = table.stock.fetch()
#             self.hand.put(card)
#             log.debug(f"{self.name} <- {card}")
# 
#     def put(self, table, card, strategy):
#         log.debug(f"play {card}")
#         card = self.hand.fetch(card)
#         table.waste.put(table.upcard)
#         table.upcard = card
#         oldRule = table.rule
#         table.rule = table.rules.get_rule(card)
#         table.rule.strategy = strategy
#         table.transfer_punishments(oldRule, table.rule)


# Path: tests/test_player.py
from mau_mau.subjects import Player



def test_player_inequality():
    assert Player("John") != Player("Eric")


def test_player_equality():
    assert Player("Terry") == Player("Terry")


def test_players_with_same_name_can_be_different_objects():

    assert Player("Terry") is not Player("Terry")