start ui 2

This commit is contained in:
Tim Bentley 2017-12-20 17:44:52 +00:00
parent 66d450464b
commit e055ed65a3
2 changed files with 10 additions and 14 deletions

View File

@ -43,7 +43,7 @@ class TestFormattingTagController(TestCase):
result = self.services._strip(tag)
# THEN: The tag should be returned with the wrappers removed.
self.assertEqual(result, 'tag', 'FormattingTagForm._strip should return u\'tag\' when called with u\'{tag}\'')
assert result == 'tag', 'FormattingTagForm._strip should return u\'tag\' when called with u\'{tag}\''
def test_end_tag_changed_processes_correctly(self):
"""
@ -64,11 +64,9 @@ class TestFormattingTagController(TestCase):
error, result = self.services.end_tag_changed(test['start'], test['end'])
# THEN: The result should match the predetermined value.
self.assertTrue(result == test['gen'],
'Function should handle end tag correctly : %s and %s for %s ' %
(test['gen'], result, test['start']))
self.assertTrue(error == test['valid'], 'Function should not generate unexpected error messages : %s ' %
error)
assert result == test['gen'], \
'Function should handle end tag correctly : %s and %s for %s ' % (test['gen'], result, test['start'])
assert error == test['valid'], 'Function should not generate unexpected error messages : %s ' % error
def test_start_tag_changed_processes_correctly(self):
"""
@ -88,10 +86,9 @@ class TestFormattingTagController(TestCase):
error, result = self.services.start_tag_changed(test['start'], test['end'])
# THEN: The result should match the predetermined value.
self.assertTrue(result == test['gen'], 'Function should handle end tag correctly : %s and %s ' %
(test['gen'], result))
self.assertTrue(error == test['valid'], 'Function should not generate unexpected error messages : %s ' %
error)
assert result == test['gen'], \
'Function should handle end tag correctly : %s and %s ' % (test['gen'], result)
assert error == test['valid'], 'Function should not generate unexpected error messages : %s ' % error
def test_start_html_to_end_html(self):
"""
@ -106,5 +103,4 @@ class TestFormattingTagController(TestCase):
result = self.services.start_html_to_end_html(test1)
# THEN: The result should match the predetermined value.
self.assertTrue(result == test2, 'Calculated end tag should be valid: %s and %s = %s' %
(test1, test2, result))
assert result == test2, 'Calculated end tag should be valid: %s and %s = %s' % (test1, test2, result)

View File

@ -83,8 +83,8 @@ class TestFormattingTagForm(TestCase):
call(row_count, 2, mocked_table_widget),
call(row_count, 3, mocked_table_widget)
]
self.assertEqual(expected_set_item_calls, form.tag_table_widget.setItem.call_args_list,
'setItem should have been called correctly')
assert expected_set_item_calls == form.tag_table_widget.setItem.call_args_list, \
'setItem should have been called correctly'
form.tag_table_widget.resizeRowsToContents.assert_called_with()
form.tag_table_widget.scrollToBottom.assert_called_with()
form.tag_table_widget.selectRow.assert_called_with(row_count)