def test_for_loop_too_many_args(self): cell = CellInfo(CellContent(ContentType.STRING, 'something'), CellPosition(CellType.MUST_BE_EMPTY, None), for_loop=True) msg = TipMessage(cell) assert_true(msg) assert_equals(str(msg), _ForLoopTooltipMessage.TOO_MANY_ARGUMENTS)
def get_tooltip_content(self): _iscelleditcontrolshown = self.IsCellEditControlShown() if _iscelleditcontrolshown or self._popup_menu_shown: return '' cell = self.cell_under_cursor cell_info = self._controller.get_cell_info(cell.Row, cell.Col) return TipMessage(cell_info)
def test_known_keyword(self): cell = CellInfo(CellContent(ContentType.USER_KEYWORD, 'Known', 'my_source'), CellPosition(CellType.KEYWORD, None)) msg = TipMessage(cell) assert_true(msg) assert_equal(str(msg), html_escape(_TooltipMessage.KEYWORD % 'my_source'))
def get_tooltip_content(self): """ Fixed on 4.0.0a3 if wx.VERSION >= (3, 0, 3, ''): # DEBUG wxPhoenix _iscelleditcontrolshown = self.IsCellEditControlEnabled() else: """ _iscelleditcontrolshown = self.IsCellEditControlShown() if _iscelleditcontrolshown or self._popup_menu_shown: return '' cell = self.cell_under_cursor cell_info = self._controller.get_cell_info(cell.Row, cell.Col) return TipMessage(cell_info)
def test_empty_tooltip(self): cell = CellInfo(CellContent(ContentType.EMPTY, None), CellPosition(CellType.UNKNOWN, None)) assert_false(TipMessage(cell))
def test_unknown_variable(self): cell = CellInfo( CellContent(ContentType.UNKNOWN_VARIABLE, '${unknown}'), CellPosition(CellType.UNKNOWN, None)) assert_true(TipMessage(cell))
def test_for_loop_var(self): cell = CellInfo(CellContent(ContentType.VARIABLE, '${i}'), CellPosition(CellType.MANDATORY, None), for_loop=True) assert_false(TipMessage(cell))
def test_for_loop_start(self): cell = CellInfo(CellContent(ContentType.STRING, ':FOR'), CellPosition(CellType.MANDATORY, None), for_loop=True) assert_false(TipMessage(cell))
def test_unknown_keyword(self): cell = CellInfo(CellContent(ContentType.STRING, 'What?'), CellPosition(CellType.KEYWORD, None)) msg = TipMessage(cell) assert_true(msg) assert_equals(str(msg), _TooltipMessage.KEYWORD_NOT_FOUND)