Uploaded image for project: 'Nuxeo Python Client'
  1. Nuxeo Python Client
  2. NXPY-122

Fix tests using an unregistered operation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.2
    • Component/s: None

      Description

      Issue

      [INFO]      [exec] ____________________________ test_operation_command ____________________________
      [INFO]      [exec] server = <nuxeo.client.Nuxeo object at 0x7f8463d0a990>
      [INFO]      [exec]     def test_operation_command(server):
      [INFO]      [exec]         with pytest.raises(ReadTimeout):
      [INFO]      [exec]             server.operations.execute(
      [INFO]      [exec]                 command="NuxeoDrive.CreateFile",
      [INFO]      [exec]                 parentId="",
      [INFO]      [exec]                 check_params=True,
      [INFO]      [exec] >               timeout=0.0001,
      [INFO]      [exec]             )
      [INFO]      [exec] server     = <nuxeo.client.Nuxeo object at 0x7f8463d0a990>
      [INFO]      [exec] tests/test_nuxeo.py:183: 
      [INFO]      [exec] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      [INFO]      [exec] nuxeo/operations.py:175: in execute
      [INFO]      [exec]     self.check_params(command, params)
      [INFO]      [exec] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      [INFO]      [exec] self = <nuxeo.operations.API object at 0x7f8463d0a210>
      [INFO]      [exec] command = 'NuxeoDrive.CreateFile', params = {'parentId': ''}
      [INFO]      [exec]     def check_params(self, command, params):
      [INFO]      [exec]         # type: (Text, Dict[Text, Any]) -> None
      [INFO]      [exec]         """
      [INFO]      [exec]         Check given parameters of the `command` operation.  It will also
      [INFO]      [exec]         check for types whenever possible.
      [INFO]      [exec]         """
      [INFO]      [exec]         operation = self.operations.get(command)
      [INFO]      [exec]         if not operation:
      [INFO]      [exec] >           raise BadQuery("{!r} is not a registered operation".format(command))
      [INFO]      [exec] E           BadQuery: u'NuxeoDrive.CreateFile' is not a registered operation
      [INFO]      [exec] command    = 'NuxeoDrive.CreateFile'
      [INFO]      [exec] operation  = None
      [INFO]      [exec] params     = {'parentId': ''}
      [INFO]      [exec] self       = <nuxeo.operations.API object at 0x7f8463d0a210>
      [INFO]      [exec] nuxeo/operations.py:104: BadQuery
      

      Fix

      Use Document.Create instead.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 10 minutes
                10m