Skip to content

Commit a24ed47

Browse files
authored
Merge pull request #2 from btoron/bugfix
Fixed error in get_resource_descendants
2 parents 3d1ac63 + 714cff9 commit a24ed47

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

ofsc/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def get_resource_descendants(self, resource_id, resourceFields=None, offset=0,
179179
params['expand'] = expand
180180

181181
if resourceFields is not None:
182-
params['resourceFields'] = resourceFields
182+
params['fields'] = resourceFields
183183
params['limit'] = limit
184184
params['offset']= offset
185185

ofsc/tests/OFSC_test.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import sys, os
55
sys.path.append(os.path.abspath('.'))
6-
from ofsc.core import OFSC
6+
from ofsc.core import OFSC, FULL_RESPONSE
77
import logging
88
import json
99
import argparse
@@ -162,6 +162,15 @@ def test_207_get_resource_descendants_expand(self):
162162
#print(response)
163163
self.assertEqual(response['totalResults'], 10)
164164

165+
def test_208_get_resource_descendants_noexpand_fields(self):
166+
instance = self.instance
167+
logger = self.logger
168+
raw_response = instance.get_resource_descendants(55100, resourceFields="resourceId,phone", response_type=FULL_RESPONSE)
169+
# logging.debug(self.pp.pformat(raw_response.json()))
170+
response = raw_response.json()
171+
logger.info(self.pp.pformat(response))
172+
self.assertEqual(response['totalResults'], 10)
173+
165174

166175
if __name__ == '__main__':
167176
unittest.main()

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
setup(
33
name = 'ofsc', # How you named your package folder (MyLib)
44
packages = ['ofsc'], # Chose the same as "name"
5-
version = 'v1.6.2', # Start with a small number and increase it with every change you make
5+
version = 'v1.6.3', # Start with a small number and increase it with every change you make
66
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
77
description = 'Python Wrapper for Oracle Field Service Cloud API', # Give a short description about your library
88
author = 'Borja Toron', # Type in your name
99
author_email = 'borja.toron@gmail.com', # Type in your E-Mail
1010
url = 'https://github.com/btoron/pyOFSC', # Provide either the link to your github or to your website
11-
download_url = 'https://github.com/btoron/pyOFSC/archive/v1.6.2.tar.gz', # I explain this later on
11+
download_url = 'https://github.com/btoron/pyOFSC/archive/v1.6.3.tar.gz', # I explain this later on
1212
keywords = ['OFSC', 'Python', 'ORACLE FIELD SERVICE CLOUD'], # Keywords that define your package best
1313
install_requires=[ # I get to this in a second
1414
'requests',

0 commit comments

Comments
 (0)