Skip to content

Commit fefbe01

Browse files
committed
Merge pull request #79 from jakednoble/master
fixed saveActivty bug, added corresponding test to all save document reqs
2 parents 3f7f77f + 9888687 commit fefbe01

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

test/remote_lrs_test.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,19 @@ def test_save_state(self):
485485
id="test",
486486
content=bytearray("Test value", encoding="utf-8")
487487
)
488-
response = self.lrs.save_state(doc)
488+
saveResp = self.lrs.save_state(doc)
489489

490+
self.assertIsInstance(saveResp, LRSResponse)
491+
self.assertTrue(saveResp.success)
492+
493+
response = self.lrs.retrieve_state(
494+
activity=self.activity,
495+
agent=self.agent,
496+
state_id="test"
497+
)
490498
self.assertIsInstance(response, LRSResponse)
491499
self.assertTrue(response.success)
500+
self._vars_verifier(response.content, doc)
492501

493502
def test_delete_state(self):
494503
doc = StateDocument(
@@ -525,10 +534,19 @@ def test_save_activity_profile(self):
525534
id="test",
526535
content=bytearray("Test value", encoding="utf-8")
527536
)
528-
response = self.lrs.save_activity_profile(doc)
537+
saveResp = self.lrs.save_activity_profile(doc)
538+
539+
self.assertIsInstance(saveResp, LRSResponse)
540+
self.assertTrue(saveResp.success)
529541

542+
response = self.lrs.retrieve_activity_profile(
543+
activity=self.activity,
544+
profile_id="test"
545+
)
530546
self.assertIsInstance(response, LRSResponse)
531547
self.assertTrue(response.success)
548+
self._vars_verifier(response.content, doc)
549+
532550

533551
def test_delete_activity_profile(self):
534552
doc = ActivityProfileDocument(activity=self.activity, id="test")
@@ -553,9 +571,18 @@ def test_save_agent_profile(self):
553571
id="test",
554572
content=bytearray("Test value", encoding="utf-8")
555573
)
556-
response = self.lrs.save_agent_profile(doc)
574+
saveResp = self.lrs.save_agent_profile(doc)
575+
self.assertIsInstance(saveResp, LRSResponse)
576+
self.assertTrue(saveResp.success)
577+
578+
response = self.lrs.retrieve_agent_profile(
579+
agent=self.agent,
580+
profile_id="test"
581+
)
557582
self.assertIsInstance(response, LRSResponse)
558583
self.assertTrue(response.success)
584+
self._vars_verifier(response.content, doc)
585+
559586

560587
def test_delete_agent_profile(self):
561588
doc = AgentProfileDocument(agent=self.agent, id="test")

tincan/remote_lrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def save_activity_profile(self, profile):
654654
request = HTTPRequest(
655655
method="PUT",
656656
resource="activities/profile",
657-
content=profile.content_type
657+
content=profile.content
658658
)
659659
if profile.content_type is not None:
660660
request.headers["Content-Type"] = profile.content_type

0 commit comments

Comments
 (0)