Merge lp:~trb143/openlp/startup_thread_error into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: 2430
Proposed branch: lp:~trb143/openlp/startup_thread_error
Merge into: lp:openlp
Diff against target: 68 lines (+30/-3)
2 files modified
openlp/core/ui/slidecontroller.py (+3/-3)
tests/functional/openlp_plugins/remotes/test_router.py (+27/-0)
To merge this branch: bzr merge lp:~trb143/openlp/startup_thread_error
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Review via email: mp+239769@code.launchpad.net

Description of the change

More errors found and test for security

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2014-10-21 21:06:02 +0000
+++ openlp/core/ui/slidecontroller.py 2014-10-27 20:35:38 +0000
@@ -1245,7 +1245,7 @@
1245 if event.timerId() == self.timer_id:1245 if event.timerId() == self.timer_id:
1246 self.on_slide_selected_next(self.play_slides_loop.isChecked())1246 self.on_slide_selected_next(self.play_slides_loop.isChecked())
12471247
1248 def on_edit_song(self):1248 def on_edit_song(self, field=None):
1249 """1249 """
1250 From the preview display requires the service Item to be editied1250 From the preview display requires the service Item to be editied
1251 """1251 """
@@ -1254,7 +1254,7 @@
1254 if new_item:1254 if new_item:
1255 self.add_service_item(new_item)1255 self.add_service_item(new_item)
12561256
1257 def on_preview_add_to_service(self):1257 def on_preview_add_to_service(self, field=None):
1258 """1258 """
1259 From the preview display request the Item to be added to service1259 From the preview display request the Item to be added to service
1260 """1260 """
@@ -1351,7 +1351,7 @@
1351 seconds %= 601351 seconds %= 60
1352 self.audio_time_label.setText(' %02d:%02d ' % (minutes, seconds))1352 self.audio_time_label.setText(' %02d:%02d ' % (minutes, seconds))
13531353
1354 def on_track_triggered(self):1354 def on_track_triggered(self, field=None):
1355 """1355 """
1356 Start playing a track1356 Start playing a track
1357 """1357 """
13581358
=== modified file 'tests/functional/openlp_plugins/remotes/test_router.py'
--- tests/functional/openlp_plugins/remotes/test_router.py 2014-10-22 20:47:47 +0000
+++ tests/functional/openlp_plugins/remotes/test_router.py 2014-10-27 20:35:38 +0000
@@ -107,6 +107,33 @@
107 self.assertEqual(mocked_function, function['function'], 'The mocked function should match defined value.')107 self.assertEqual(mocked_function, function['function'], 'The mocked function should match defined value.')
108 self.assertFalse(function['secure'], 'The mocked function should not require any security.')108 self.assertFalse(function['secure'], 'The mocked function should not require any security.')
109109
110 def process_secure_http_request_test(self):
111 """
112 Test the router control functionality
113 """
114 # GIVEN: A testing set of Routes
115 mocked_function = MagicMock()
116 test_route = [
117 (r'^/stage/api/poll$', {'function': mocked_function, 'secure': True}),
118 ]
119 self.router.routes = test_route
120 self.router.settings_section = 'remotes'
121 Settings().setValue('remotes/authentication enabled', True)
122 self.router.path = '/stage/api/poll'
123 self.router.auth = ''
124 self.router.headers = {'Authorization': None}
125 self.router.send_response = MagicMock()
126 self.router.send_header = MagicMock()
127 self.router.end_headers = MagicMock()
128 self.router.wfile = MagicMock()
129
130 # WHEN: called with a poll route
131 self.router.do_post_processor()
132
133 # THEN: the function should have been called only once
134 self.router.send_response.assert_called_once_with(401)
135 self.assertEqual(self.router.send_header.call_count, 2, 'The header should have been called twice.')
136
110 def get_content_type_test(self):137 def get_content_type_test(self):
111 """138 """
112 Test the get_content_type logic139 Test the get_content_type logic