forked from openedx/openedx-events
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: [ACI-949] increase coverage & fix status field problem (#13)
* test: [ACI-949] increase coverage & fix status field problem * refactor: [ACI-949] remove redundant comments --------- Co-authored-by: Andrii <[email protected]>
- Loading branch information
1 parent
f7995b9
commit 619289a
Showing
3 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
openedx_events/event_bus/avro/tests/test_custom_serializers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from unittest import TestCase | ||
|
||
from ccx_keys.locator import CCXLocator | ||
|
||
from openedx_events.event_bus.avro.custom_serializers import ( | ||
CcxCourseLocatorAvroSerializer, | ||
) | ||
|
||
|
||
class TestCCXLocatorSerailizer(TestCase): | ||
def test_serialize(self): | ||
obj1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") | ||
expected1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" | ||
result1 = CcxCourseLocatorAvroSerializer.serialize(obj1) | ||
self.assertEqual(result1, expected1) | ||
|
||
def test_deseialize(self): | ||
data1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" | ||
expected1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") | ||
result1 = CcxCourseLocatorAvroSerializer.deserialize(data1) | ||
self.assertEqual(result1, expected1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters