def test_adafruit_mode_no_charts(): """ If QCharts is not available, ensure the plotter feature is not available. """ editor = mock.MagicMock() view = mock.MagicMock() am = AdafruitMode(editor, view) with mock.patch('mu.modes.adafruit.CHARTS', False): actions = am.actions() assert len(actions) == 1 assert actions[0]['name'] == 'repl' assert actions[0]['handler'] == am.toggle_repl
def test_adafruit_mode(): """ Sanity check for setting up the mode. """ editor = mock.MagicMock() view = mock.MagicMock() am = AdafruitMode(editor, view) assert am.name == 'Adafruit CircuitPython' assert am.description is not None assert am.icon == 'adafruit' assert am.editor == editor assert am.view == view actions = am.actions() assert len(actions) == 1 assert actions[0]['name'] == 'repl' assert actions[0]['handler'] == am.toggle_repl
def test_adafruit_mode(): """ Sanity check for setting up the mode. """ editor = mock.MagicMock() view = mock.MagicMock() am = AdafruitMode(editor, view) assert am.name == 'Adafruit CircuitPython' assert am.description is not None assert am.icon == 'adafruit' assert am.editor == editor assert am.view == view actions = am.actions() assert len(actions) == 2 assert actions[0]['name'] == 'repl' assert actions[0]['handler'] == am.toggle_repl assert actions[1]['name'] == 'plotter' assert actions[1]['handler'] == am.toggle_plotter