Skip to content

Commit

Permalink
Merge 942b3f6 into c0603bc
Browse files Browse the repository at this point in the history
  • Loading branch information
fanglinfang committed Dec 24, 2022
2 parents c0603bc + 942b3f6 commit bf0e09e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
7 changes: 1 addition & 6 deletions uw_hrp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

"""
This is the interface for interacting with
the hrp web service.
This is the interface for interacting with the hrp web service.
"""

import logging
Expand All @@ -16,10 +15,6 @@

def get_resource(url):
response = HRP_DAO().getURL(url, {'Accept': 'application/json'})

logger.debug("{0} ==status==> {1}".format(url, response.status))
if response.status != 200:
raise DataFailureException(url, response.status, response.data)

logger.debug("{0} ==data==> {1}".format(url, response.data))
return response.data
4 changes: 2 additions & 2 deletions uw_hrp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def to_json(self):
'budget_code': self.budget_code,
'end_date': date_to_str(self.end_date),
'is_primary': self.is_primary,
'job_title': self.title,
'job_title': self.job_title,
'job_class': self.job_class,
'location': self.location,
'org_code': self.org_code,
Expand All @@ -147,7 +147,7 @@ def __init__(self, *args, **kwargs):
if data is None:
return super(EmploymentDetails, self).__init__(*args, **kwargs)

self.title = data.get("BusinessTitle")
self.job_title = data.get("BusinessTitle")
self.job_profile = JobProfile(data=data.get("JobProfile"))

self.job_class = get_emp_program_job_class(
Expand Down
21 changes: 13 additions & 8 deletions uw_hrp/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,23 @@ def test_employment_status(self):
def test_job_profile(self):
job_prof = JobProfile(job_code="1", description="A")
self.assertIsNotNone(job_prof)
job_prof = JobProfile(
data={
self.assertEqual(JobProfile(
data={"Name": "Unpaid", "IDs": []}).to_json(),
{
'job_code': None, 'description': 'Unpaid'
}
)

job_prof = JobProfile(data={
"Name": "Unpaid Academic",
"WID": "d957207a306801fc5c30a8906f5c6b57",
"IDs": [
{
"Type": "WID",
"Value": "d957207a306801fc5c30a8906f5c6b57"
},
{
"Type": "Job_Profile_ID",
"Value": "21184"
},
{
"Type": "WID",
"Value": "d957207a306801fc5c30a8906f5c6b57"
}
]
}
Expand Down Expand Up @@ -369,7 +374,7 @@ def test_worker(self):
'status': 'Active',
'termination_date': None
},
'primary_job_title': None,
'primary_job_title': 'Student Assistant (NE H)',
'primary_manager_id': None,
'worker_wid': '1b68136df25201c0710e3ddad462fa1d'
}
Expand Down

0 comments on commit bf0e09e

Please sign in to comment.