コード例 #1
0
 def test_optional_has_no_error(self):
     assert_false(
         CellInfo(CellContent(ContentType.EMPTY, '', ''),
                  CellPosition(CellType.OPTIONAL, None)).has_error())
     assert_false(
         CellInfo(CellContent(ContentType.STRING, '', ''),
                  CellPosition(CellType.OPTIONAL, None)).has_error())
コード例 #2
0
 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)
コード例 #3
0
 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'))
コード例 #4
0
ファイル: stepcontrollers.py プロジェクト: MEDBEDb/RIDE
 def _build_cell_info(self, content, position):
     return CellInfo(content, position, for_loop=True)
コード例 #5
0
 def test_empty_mandatory_empty_is_not_error(self):
     cell = CellInfo(CellContent(ContentType.EMPTY, '', ''),
                     CellPosition(CellType.MUST_BE_EMPTY, None))
     assert_false(cell.has_error())
     assert_false(cell.too_many_arguments())
コード例 #6
0
 def test_commented_mandatory_is_error(self):
     cell = CellInfo(CellContent(ContentType.COMMENTED, '', ''),
                     CellPosition(CellType.MANDATORY, None))
     assert_true(cell.has_error())
     assert_true(cell.argument_missing())
コード例 #7
0
 def test_none_empty_mandatory_is_not_error(self):
     cell = CellInfo(CellContent(ContentType.LIBRARY_KEYWORD, '', ''),
                     CellPosition(CellType.MANDATORY, None))
     assert_false(cell.has_error())
     assert_false(cell.argument_missing())
コード例 #8
0
 def test_empty_tooltip(self):
     cell = CellInfo(CellContent(ContentType.EMPTY, None),
                     CellPosition(CellType.UNKNOWN, None))
     assert_false(TipMessage(cell))
コード例 #9
0
 def test_none_empty_mandatory_is_not_error(self):
     cell = CellInfo(CellContent(ContentType.LIBRARY_KEYWORD, '', ''),
                     CellPosition(CellType.MANDATORY, None))
     assert_false(cell.has_error())
     assert_false(cell.argument_missing())
コード例 #10
0
 def test_for_loop_var(self):
     cell = CellInfo(CellContent(ContentType.VARIABLE, '${i}'),
                     CellPosition(CellType.MANDATORY, None),
                     for_loop=True)
     assert_false(TipMessage(cell))
コード例 #11
0
 def test_for_loop_start(self):
     cell = CellInfo(CellContent(ContentType.STRING, ':FOR'),
                     CellPosition(CellType.MANDATORY, None),
                     for_loop=True)
     assert_false(TipMessage(cell))
コード例 #12
0
 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)
コード例 #13
0
 def test_empty_mandatory_empty_is_not_error(self):
     cell = CellInfo(CellContent(ContentType.EMPTY, '', ''),
                     CellPosition(CellType.MUST_BE_EMPTY, None))
     assert_false(cell.has_error())
     assert_false(cell.too_many_arguments())
コード例 #14
0
 def test_commented_mandatory_is_error(self):
     cell = CellInfo(CellContent(ContentType.COMMENTED, '', ''),
                     CellPosition(CellType.MANDATORY, None))
     assert_true(cell.has_error())
     assert_true(cell.argument_missing())
コード例 #15
0
ファイル: stepcontrollers.py プロジェクト: MEDBEDb/RIDE
 def _build_cell_info(self, content, position):
     return CellInfo(content, position)
コード例 #16
0
 def get_cell_info(self, row, column):
     return CellInfo(
         CellContent(self._get(self.content_types), self._get_data(), None),
         CellPosition(self._get(self.cell_types), None))
コード例 #17
0
 def test_unknown_variable(self):
     cell = CellInfo(
         CellContent(ContentType.UNKNOWN_VARIABLE, '${unknown}'),
         CellPosition(CellType.UNKNOWN, None))
     assert_true(TipMessage(cell))