openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #29750
[Merge] lp:~trb143/openlp/mayfixes24 into lp:openlp/2.4
Tim Bentley has proposed merging lp:~trb143/openlp/mayfixes24 into lp:openlp/2.4.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~trb143/openlp/mayfixes24/+merge/295507
Fix Android SSL
Fix Service Manager
Fix Formatting Tags
Add test
--
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/mayfixes24 into lp:openlp/2.4.
=== modified file 'openlp/core/lib/spelltextedit.py'
--- openlp/core/lib/spelltextedit.py 2015-12-31 22:46:06 +0000
+++ openlp/core/lib/spelltextedit.py 2016-05-23 18:36:35 +0000
@@ -142,6 +142,7 @@
"""
Replaces the selected text with word.
"""
+ tag = tag.replace('&', '')
for html in FormattingTags.get_html_tags():
if tag == html['desc']:
cursor = self.textCursor()
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2016-04-02 17:58:27 +0000
+++ openlp/core/ui/servicemanager.py 2016-05-23 18:36:35 +0000
@@ -1322,8 +1322,8 @@
The theme may have changed in the settings dialog so make sure the theme combo box is in the correct state.
"""
visible = self.renderer.theme_level == ThemeLevel.Global
- self.theme_label.setVisible(visible)
- self.theme_combo_box.setVisible(visible)
+ self.toolbar.actions['theme_combo_box'].setVisible(visible)
+ self.toolbar.actions['theme_label'].setVisible(visible)
self.regenerate_service_items()
def regenerate_service_items(self, changed=False):
=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/remotes/lib/httpserver.py 2016-05-23 18:36:35 +0000
@@ -167,7 +167,6 @@
local_data = AppLocation.get_directory(AppLocation.DataDir)
self.socket = ssl.SSLSocket(
sock=socket.socket(self.address_family, self.socket_type),
- ssl_version=ssl.PROTOCOL_TLSv1_2,
certfile=os.path.join(local_data, 'remotes', 'openlp.crt'),
keyfile=os.path.join(local_data, 'remotes', 'openlp.key'),
server_side=True)
=== modified file 'tests/functional/openlp_plugins/remotes/test_router.py'
--- tests/functional/openlp_plugins/remotes/test_router.py 2016-01-11 21:57:45 +0000
+++ tests/functional/openlp_plugins/remotes/test_router.py 2016-05-23 18:36:35 +0000
@@ -378,3 +378,26 @@
# THEN: we should use the specific stage file instance
self.router._process_file.assert_called_with(os.path.join('trb', 'trb.css'))
+
+ def serve_file_with_partial_params_test(self):
+ """
+ Test the serve_file method with an existing file
+ """
+ # GIVEN: mocked environment
+ self.router.send_response = MagicMock()
+ self.router.send_header = MagicMock()
+ self.router.end_headers = MagicMock()
+ self.router.wfile = MagicMock()
+ self.router.html_dir = os.path.normpath('test/dir')
+ self.router.template_vars = MagicMock()
+ with patch('openlp.core.lib.os.path.exists') as mocked_exists, \
+ patch('builtins.open', mock_open(read_data='123')):
+ mocked_exists.return_value = True
+
+ # WHEN: call serve_file with an existing html file
+ self.router.serve_file(os.path.normpath('test/dir/test'))
+
+ # THEN: it should return a 200 and the file
+ self.router.send_response.assert_called_once_with(200)
+ self.router.send_header.assert_called_once_with('Content-type', 'text/plain')
+ self.assertEqual(self.router.end_headers.call_count, 1, 'end_headers called once')
Follow ups