Skip to content

Commit

Permalink
fix: [ACI-152] fix ci failure (#12)
Browse files Browse the repository at this point in the history
* fix: [ACI-152] fix django tests failure

* style: [ACI-152] adjust code style to pylint requirements

---------

Co-authored-by: Andrii <andrii.hantkovskyi@raccoongang.com>
  • Loading branch information
andrii-hantkovskyi and Andrii authored Apr 18, 2024
1 parent 6d3168d commit 6a918eb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@
}
}
],
"namespace": "org.openedx.learning.ccx.course.passing.status.v1"
"namespace": "org.openedx.learning.ccx.course.passing.status.updated.v1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@
}
}
],
"namespace": "org.openedx.learning.course.passing.status.v1"
"namespace": "org.openedx.learning.course.passing.status.updated.v1"
}
4 changes: 3 additions & 1 deletion openedx_events/event_bus/avro/tests/test_avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import List
from unittest import TestCase

from ccx_keys.locator import CCXLocator
from fastavro import schemaless_reader, schemaless_writer
from fastavro.repository.base import SchemaRepositoryError
from fastavro.schema import load_schema
Expand Down Expand Up @@ -97,7 +98,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover
defaults_per_type = {
int: 1,
bool: True,
str: "default",
str: "passing",
float: 1.0,
CourseKey: CourseKey.from_string("course-v1:edX+DemoX.1+2014"),
UsageKey: UsageKey.from_string(
Expand All @@ -107,6 +108,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover
LibraryUsageLocatorV2: LibraryUsageLocatorV2.from_string('lb:MITx:reallyhardproblems:problem:problem1'),
List[int]: [1, 2, 3],
datetime: datetime.now(),
CCXLocator: CCXLocator(org='edx', course='DemoX', run='Demo_course', ccx='1'),
}
data_dict = {}
for attribute in data_type.__attrs_attrs__:
Expand Down
14 changes: 10 additions & 4 deletions openedx_events/learning/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class CcxCourseData:
coach_email (str): The email address of the coach (instructor) for the CCX course.
start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date.
end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date.
max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit.
max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course.
Defaults to None, indicating no limit.
"""

ccx_course_key = attr.ib(type=CCXLocator)
Expand Down Expand Up @@ -510,10 +511,13 @@ class CoursePassingStatusData:
Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing.
Attributes:
status (str): A string containing information about user's current course grade value in comparison to the grading policy threshold.
status (str): A string containing information about user's current course grade value
in comparison to the grading policy threshold.
user (UserData): An instance of UserData containing information about the user whose grade was updated.
course (CourseData): An instance of CourseData containing details about the course in which the grade was updated.
course (CourseData): An instance of CourseData containing details about the course
in which the grade was updated.
"""

PASSING = 'passing'
FAILING = 'failing'
STATUSES = [PASSING, FAILING]
Expand All @@ -532,9 +536,11 @@ class CcxCoursePassingStatusData(CoursePassingStatusData):
providing a custom course attribute suited for CCX course instances.
Attributes:
course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course in which the grade threshold was crossed.
course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course
in which the grade threshold was crossed.
All other attributes are inherited from CoursePassingStatusData.
"""

course = attr.ib(type=CcxCourseData)


Expand Down
4 changes: 2 additions & 2 deletions openedx_events/learning/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
CourseAccessRoleData,
CourseDiscussionConfigurationData,
CourseEnrollmentData,
CoursePassingStatusData,
CourseNotificationData,
CoursePassingStatusData,
DiscussionThreadData,
ExamAttemptData,
ORASubmissionData,
Expand Down Expand Up @@ -400,4 +400,4 @@
data={
"badge": BadgeData,
}
)
)

0 comments on commit 6a918eb

Please sign in to comment.