openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #28152
Re: [Merge] lp:~alisonken1/openlp/ticket-921817 into lp:openlp
Review: Needs Fixing
Need to get jenkins working as some point
Diff comments:
>
> === added file 'tests/functional/openlp_core_lib/test_projector_pjlink1.py'
> --- tests/functional/openlp_core_lib/test_projector_pjlink1.py 1970-01-01 00:00:00 +0000
> +++ tests/functional/openlp_core_lib/test_projector_pjlink1.py 2016-01-03 08:34:41 +0000
> @@ -0,0 +1,57 @@
> +# -*- coding: utf-8 -*-
> +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
> +
> +###############################################################################
> +# OpenLP - Open Source Lyrics Projection #
> +# --------------------------------------------------------------------------- #
> +# Copyright (c) 2008-2015 OpenLP Developers #
> +# --------------------------------------------------------------------------- #
> +# This program is free software; you can redistribute it and/or modify it #
> +# under the terms of the GNU General Public License as published by the Free #
> +# Software Foundation; version 2 of the License. #
> +# #
> +# This program is distributed in the hope that it will be useful, but WITHOUT #
> +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
> +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
> +# more details. #
> +# #
> +# You should have received a copy of the GNU General Public License along #
> +# with this program; if not, write to the Free Software Foundation, Inc., 59 #
> +# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
> +###############################################################################
> +"""
> +Package to test the openlp.core.lib.projector.pjlink1 package.
> +"""
> +
> +from unittest import TestCase
> +
> +from mock import MagicMock, patch
> +
> +from openlp.core.lib.projector.pjlink1 import PJLink1
> +
> +from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_CONNECT_AUTHENTICATE
> +
> +pjlink = PJLink1(name='test', ip='127.0.0.1', pin=TEST_PIN, no_poll=True)
> +
> +
> +class TestPJLink(TestCase):
> + """
> + Tests for the PJLink module
> + """
> + @patch.object(pjlink, 'readyRead')
> + @patch.object(pjlink, 'send_command')
> + @patch.object(pjlink, 'waitForReadyRead')
Why do I need these 3 here?
If it is to sep up hidden objects then should they not be created in a # GIVEN: which is missing
# GIVEN and working pjlink
> + @patch('openlp.core.common.qmd5_hash')
> + def ticket_92187_test(self,
> + mock_qmd5_hash,
> + mock_waitForReadyRead,
> + mock_send_command,
> + mock_readyRead):
> + """
> + Fix for projector connect with PJLink authentication exception
> + """
> + # WHEN: Calling check_login with authentication request:
> + pjlink.check_login(data=TEST_CONNECT_AUTHENTICATE)
> +
> + # THEN: Should have called qmd5_hash
> + mock_qmd5_hash.called_with(TEST_SALT, TEST_PIN)
--
https://code.launchpad.net/~alisonken1/openlp/ticket-921817/+merge/281478
Your team OpenLP Core is subscribed to branch lp:openlp.
Follow ups
References