~alisonken1/openlp/pjlink2-f

« back to all changes in this revision

Viewing changes to tests/functional/openlp_core_lib/test_projector_pjlink1.py

  • Committer: Tim Bentley
  • Author(s): Ken Roberts
  • Date: 2017-05-17 20:34:14 UTC
  • mfrom: (2733.1.2 pjlink2-a)
  • Revision ID: tim.bentley@gmail.com-20170517203414-ao8bliafoaa8cs43
Initial PJLink class 2 updates

- Converted PJLINK_DEFAULT_CODES from a static dictionary to dynamically-built dictionary
- Added _not_implemented method to be able to list future methods while updating
- Added class list to hold future method functionality
- Added class list for UDP commands
- Added test for building PJLINK_DEFAULT_CODES dictionary
- Added test for _not_implemented method
- Removed extraneous TODO

--------------------------------
lp:~alisonken1/openlp/pjlink2-a (revision 27...

Show diffs side-by-side

added added

removed removed

Lines of Context:
366
366
        # THEN: send_command should have the proper authentication
367
367
        self.assertEquals("{test}".format(test=mock_send_command.call_args),
368
368
                          "call(data='{hash}%1CLSS ?\\r')".format(hash=TEST_HASH))
 
369
 
 
370
    @patch.object(pjlink_test, '_not_implemented')
 
371
    def not_implemented_test(self, mock_not_implemented):
 
372
        """
 
373
        Test pjlink1._not_implemented method being called
 
374
        """
 
375
        # GIVEN: test object
 
376
        pjlink = pjlink_test
 
377
        test_cmd = 'TESTMEONLY'
 
378
 
 
379
        # WHEN: A future command is called that is not implemented yet
 
380
        pjlink.process_command(test_cmd, "Garbage data for test only")
 
381
 
 
382
        # THEN: pjlink1.__not_implemented should have been called with test_cmd
 
383
        mock_not_implemented.assert_called_with(test_cmd)