def test_get_db_statistics(self, mock_messagebar): """ Test that calculate_db_table_rows can be run without major error :param mock_iface: :return: """ utils.calculate_db_table_rows() assert len(str(mock_messagebar.mock_calls[0])) > 1500 and 'about_db' in str(mock_messagebar.mock_calls[0])
def test_get_db_statistics(self, mock_iface): """ Test that calculate_db_table_rows can be run without major error :param mock_iface: :return: """ utils.calculate_db_table_rows() calls = [str(call) for call in mock_iface.mock_calls] assert """call.messageBar().createMessage(u'Some sql failure, see log for additional info.')""" not in calls assert """call.messageBar().createMessage(u'Calculation done, see log for results.')""" in calls