Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. def test_bug_1593882_no_pin_authenticated_connection(self):
  2.     """
  3.    Test bug 1593882 no pin and authenticated request exception
  4.    """
  5.    
  6.     with self.patch.object(self.pjlink_test, 'socket_timer'), self.patch.object(self.pjlink_test, 'timer'), \
  7.          self.patch.object(self.pjlink_test, 'projectorAuthentication') as mock_authentication, \
  8.             self.patch.object(self.pjlink_test, 'waitForReadyRead') as mock_ready_read, \
  9.             self.patch.object(self.pjlink_test, 'send_command'):
  10.        
  11.         # GIVEN: Test object and mocks
  12.         pjlink = self.pjlink_test
  13.         pjlink.pin = None
  14.         mock_ready_read.return_value = True
  15.    
  16.         # WHEN: call with authentication request and pin not set
  17.         pjlink.check_login(data=TEST_CONNECT_AUTHENTICATE)
  18.    
  19.         # THEN: 'No Authentication' signal should have been sent
  20.         mock_authentication.emit.assert_called_with(pjlink.ip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement