hydroshare / hs_restclient

Python client for the https://www.hydroshare.org REST API
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

67 add irods tickets #72

Closed alvacouch closed 5 years ago

alvacouch commented 7 years ago

@pkdash This creates iRODS tickets using the new Django REST API for iRODS tickets. Would appreciate some guidance in creating mock tests. This is harder than testing live against cuahsi-dev-2 !!!

alvacouch commented 7 years ago

@pkdash what is the deal with setting up testing? Tests I didn't mess with are failing.

======================================================================
ERROR: test_resource_upload_file (__main__.TestResourceUploadFileToFolder)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/httmock.py", line 248, in inner
    return func(*args, **kwargs)
  File "test_hs_restclient.py", line 448, in test_resource_upload_file
    self.assertEqual(response.status_code, 200)
AttributeError: 'unicode' object has no attribute 'status_code'

======================================================================
FAIL: test_resource_unzip_file (__main__.TestResourceZipUnzip)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/httmock.py", line 248, in inner
    return func(*args, **kwargs)
  File "test_hs_restclient.py", line 436, in test_resource_unzip_file
    self.assertEqual(response.status_code, 200)
AssertionError: 404 != 200

Are there prerequisites in the environment that are causing this?

alvacouch commented 7 years ago

OK, @pkdash, this is my best effort at creating ticket handling for the hs_restclient. Feedback requested.

pkdash commented 7 years ago

@alvacouch Will try to look at this soon.

pkdash commented 7 years ago

@alvacouch I have left some minor comments above. Also, I think the requires.txt file needs to include icommands so that one pip install installs all dependencies.

alvacouch commented 7 years ago

@pkdash It is going to be difficult to automatically install icommands. The only version we have is on the renci servers. It is not accessible to apt-get or yum. Here is how HydroShare does it:

RUN curl ftp://ftp.renci.org/pub/irods/releases/4.1.8/ubuntu14/irods-runtime-4.1.8-ubuntu14-x86_64.deb -o irods-runtime.deb \
    && curl ftp://ftp.renci.org/pub/irods/releases/4.1.8/ubuntu14/irods-icommands-4.1.8-ubuntu14-x86_64.deb -o irods-icommands.deb \
    && sudo dpkg -i irods-runtime.deb irods-icommands.deb \
    && sudo apt-get -f install \
    && rm irods-runtime.deb irods-icommands.deb

This is in the Dockerfile. I think I need to code such a thing into setup.py at top level?

pkdash commented 7 years ago

@alvacouch

It is going to be difficult to automatically install icommands

In that case we should include documentation on how to install icommands here (https://github.com/hydroshare/hs_restclient/blob/develop/docs/index.rst). Also, in the ticket related APIs we should make a note as part of the docstring that icommands installation is required.

ghost commented 5 years ago

@alvacouch let's close this out