def test_base_model_supported_commands(): """ Ensure that if a CashRegister has defined some supported commands, the get_supported_commands() returns a list of commands. """ # create an instance ad override supported commands register = CashRegister('Sarema X2') register._supported_commands = [object()] commands = register.get_supported_commands() assert register._supported_commands == commands
def test_base_model_supported_commands(): """ Ensure that if a CashRegister has defined some supported commands, the get_supported_commands() returns a new list that doesn't change the original instance's list. """ # create an instance ad override supported commands register = CashRegister('Sarema X2') register._supported_commands = [object()] commands = register.get_supported_commands() # update supported commands list commands.append(object()) # the instance list is not updated assert register._supported_commands != commands