def test_Board_console_setter_should_set_current_console(): board = Board(name='board') console2 = MagicMock(ConsoleBase) board.console = console2 assert board.console is console2
def test_Board_console_setter_should_reset_consoles_if_not_in_the_list(): console1 = MagicMock(ConsoleBase) console1_name = 'abc' board = Board(name='board', console={console1_name: console1}) console2 = MagicMock(ConsoleBase) board.console = console2 assert board.get_console(console1_name) is None
def test_Board_console_setter_should_keep_consoles_if_in_the_list(): console1 = MagicMock(ConsoleBase) console1_name = 'abc' console2 = MagicMock(ConsoleBase) console2_name = 'def' consoles = {console1_name: console1, console2_name: console2} board = Board(name='board', console=consoles) assert board.console is console1 board.console = console2 assert board.console is console2 assert board.consoles == consoles