From db09a518d197a8e1b7ba941e9fd037c8252778c2 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 20:15:41 +0000 Subject: [PATCH 1/4] feat(core): implement domain dataclasses for issue #5 - Create core/__init__.py - Create core/models.py with all domain dataclasses: - Bounty (base class) - GroupBounty (extends Bounty) - PersonalBounty (extends Bounty) - TrackedBounty - GroupData - TrackingData - UserData - Create tests/test_models.py with 15 passing tests Fixes #5 --- core/__init__.py | 21 ++++++ core/models.py | 63 ++++++++++++++++ tests/test_models.py | 167 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 251 insertions(+) create mode 100644 core/__init__.py create mode 100644 core/models.py create mode 100644 tests/test_models.py diff --git a/core/__init__.py b/core/__init__.py new file mode 100644 index 0000000..3004cfa --- /dev/null +++ b/core/__init__.py @@ -0,0 +1,21 @@ +"""Core domain models for JIGAIDO.""" + +from core.models import ( + Bounty, + GroupBounty, + PersonalBounty, + TrackedBounty, + GroupData, + TrackingData, + UserData, +) + +__all__ = [ + "Bounty", + "GroupBounty", + "PersonalBounty", + "TrackedBounty", + "GroupData", + "TrackingData", + "UserData", +] diff --git a/core/models.py b/core/models.py new file mode 100644 index 0000000..9c55720 --- /dev/null +++ b/core/models.py @@ -0,0 +1,63 @@ +"""Domain dataclasses for JIGAIDO bounty tracker.""" + +from dataclasses import dataclass +from typing import Optional + + +@dataclass +class Bounty: + """Base bounty with common fields.""" + + id: int + text: Optional[str] + link: Optional[str] + due_date_ts: Optional[int] + created_at: int + + +@dataclass +class GroupBounty(Bounty): + """Bounty created in a group context.""" + + created_by_user_id: int + + +@dataclass +class PersonalBounty(Bounty): + """Bounty created in DM/personal context.""" + + pass + + +@dataclass +class TrackedBounty: + """A bounty that a user is tracking.""" + + bounty_id: int + created_at: int + + +@dataclass +class GroupData: + """All data for a group.""" + + group_id: int + bounties: list[GroupBounty] + next_id: int + + +@dataclass +class TrackingData: + """User tracking data within a group.""" + + user_id: int + tracked: list[TrackedBounty] + + +@dataclass +class UserData: + """All personal bounties for a user (DM mode).""" + + user_id: int + bounties: list[PersonalBounty] + next_id: int diff --git a/tests/test_models.py b/tests/test_models.py new file mode 100644 index 0000000..2afe0e9 --- /dev/null +++ b/tests/test_models.py @@ -0,0 +1,167 @@ +"""Tests for core/models.py — domain dataclasses.""" + +import time + +import pytest + +from core.models import ( + Bounty, + GroupBounty, + PersonalBounty, + TrackedBounty, + GroupData, + TrackingData, + UserData, +) + + +class TestBounty: + def test_create_bounty(self): + b = Bounty( + id=1, + text="Fix the bug", + link="https://github.com/example/repo/issues/1", + due_date_ts=1735689600, + created_at=1735603200, + ) + assert b.id == 1 + assert b.text == "Fix the bug" + assert b.link == "https://github.com/example/repo/issues/1" + assert b.due_date_ts == 1735689600 + assert b.created_at == 1735603200 + + def test_bounty_optional_fields_can_be_none(self): + b = Bounty( + id=1, + text=None, + link=None, + due_date_ts=None, + created_at=0, + ) + assert b.text is None + assert b.link is None + assert b.due_date_ts is None + + def test_bounty_comparison(self): + b1 = Bounty(id=1, text="a", link=None, due_date_ts=None, created_at=0) + b2 = Bounty(id=1, text="a", link=None, due_date_ts=None, created_at=0) + assert b1 == b2 + + +class TestGroupBounty: + def test_create_group_bounty(self): + gb = GroupBounty( + id=1, + text="Group task", + link=None, + due_date_ts=None, + created_at=0, + created_by_user_id=123456, + ) + assert gb.id == 1 + assert gb.text == "Group task" + assert gb.created_by_user_id == 123456 + + def test_group_bounty_inherits_from_bounty(self): + gb = GroupBounty( + id=1, + text="Task", + link="https://example.com", + due_date_ts=int(time.time()), + created_at=0, + created_by_user_id=999, + ) + assert isinstance(gb, Bounty) + + +class TestPersonalBounty: + def test_create_personal_bounty(self): + pb = PersonalBounty( + id=1, + text="Personal task", + link=None, + due_date_ts=None, + created_at=0, + ) + assert pb.id == 1 + assert pb.text == "Personal task" + + def test_personal_bounty_inherits_from_bounty(self): + pb = PersonalBounty( + id=1, + text="Task", + link=None, + due_date_ts=None, + created_at=0, + ) + assert isinstance(pb, Bounty) + + +class TestTrackedBounty: + def test_create_tracked_bounty(self): + tb = TrackedBounty(bounty_id=5, created_at=1735600000) + assert tb.bounty_id == 5 + assert tb.created_at == 1735600000 + + def test_tracked_bounty_comparison(self): + tb1 = TrackedBounty(bounty_id=1, created_at=0) + tb2 = TrackedBounty(bounty_id=1, created_at=0) + assert tb1 == tb2 + + +class TestGroupData: + def test_create_group_data(self): + gd = GroupData( + group_id=-1001, + bounties=[], + next_id=1, + ) + assert gd.group_id == -1001 + assert gd.bounties == [] + assert gd.next_id == 1 + + def test_group_data_with_bounties(self): + gb = GroupBounty( + id=1, + text="Task", + link=None, + due_date_ts=None, + created_at=0, + created_by_user_id=123, + ) + gd = GroupData(group_id=-1001, bounties=[gb], next_id=2) + assert len(gd.bounties) == 1 + assert gd.bounties[0].text == "Task" + + +class TestTrackingData: + def test_create_tracking_data(self): + td = TrackingData(user_id=123456, tracked=[]) + assert td.user_id == 123456 + assert td.tracked == [] + + def test_tracking_data_with_tracked(self): + tb = TrackedBounty(bounty_id=5, created_at=0) + td = TrackingData(user_id=123, tracked=[tb]) + assert len(td.tracked) == 1 + assert td.tracked[0].bounty_id == 5 + + +class TestUserData: + def test_create_user_data(self): + ud = UserData(user_id=123456, bounties=[], next_id=1) + assert ud.user_id == 123456 + assert ud.bounties == [] + assert ud.next_id == 1 + + def test_user_data_with_bounties(self): + pb = PersonalBounty( + id=1, + text="My task", + link=None, + due_date_ts=None, + created_at=0, + ) + ud = UserData(user_id=123, bounties=[pb], next_id=2) + assert len(ud.bounties) == 1 + assert ud.bounties[0].text == "My task" -- 2.49.1 From f1ef33451c09377ac2860eaee0d984e21d7d45f9 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:47:26 +0000 Subject: [PATCH 2/4] Address PR #19 review feedback: simplify models - Remove GroupBounty/PersonalBounty subclasses, use Bounty with optional created_by_user_id - Combine UserData/GroupData into RoomData with room_id and is_group fields - Add group_id field to TrackingData (supports negative Telegram group IDs) - Add test_bounty_comparison_not_equal for verifying different bounties are not equal - Update core/__init__.py exports --- core/__init__.py | 10 +-- core/models.py | 50 ++++++-------- tests/test_models.py | 153 ++++++++++++++++++++----------------------- 3 files changed, 95 insertions(+), 118 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index 3004cfa..2d99708 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -2,20 +2,14 @@ from core.models import ( Bounty, - GroupBounty, - PersonalBounty, TrackedBounty, - GroupData, + RoomData, TrackingData, - UserData, ) __all__ = [ "Bounty", - "GroupBounty", - "PersonalBounty", "TrackedBounty", - "GroupData", + "RoomData", "TrackingData", - "UserData", ] diff --git a/core/models.py b/core/models.py index 9c55720..12a240d 100644 --- a/core/models.py +++ b/core/models.py @@ -6,27 +6,18 @@ from typing import Optional @dataclass class Bounty: - """Base bounty with common fields.""" + """Bounty - used for both group and personal bounties. + + Use created_by_user_id to distinguish: if set, it's a group bounty + created by that user. If None, it's a personal/DM bounty. + """ id: int text: Optional[str] link: Optional[str] due_date_ts: Optional[int] created_at: int - - -@dataclass -class GroupBounty(Bounty): - """Bounty created in a group context.""" - - created_by_user_id: int - - -@dataclass -class PersonalBounty(Bounty): - """Bounty created in DM/personal context.""" - - pass + created_by_user_id: Optional[int] = None @dataclass @@ -38,26 +29,27 @@ class TrackedBounty: @dataclass -class GroupData: - """All data for a group.""" +class RoomData: + """All data for a room (group or DM). - group_id: int - bounties: list[GroupBounty] + For groups: is_group=True, room_id is negative (Telegram group ID) + For DMs: is_group=False, room_id is the user_id (positive) + next_id is used to generate unique bounty IDs within this room. + """ + + room_id: int + is_group: bool + bounties: list[Bounty] next_id: int @dataclass class TrackingData: - """User tracking data within a group.""" + """User tracking data within a group. + group_id is the Telegram group ID (always negative). + """ + + group_id: int user_id: int tracked: list[TrackedBounty] - - -@dataclass -class UserData: - """All personal bounties for a user (DM mode).""" - - user_id: int - bounties: list[PersonalBounty] - next_id: int diff --git a/tests/test_models.py b/tests/test_models.py index 2afe0e9..f36843b 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -6,12 +6,9 @@ import pytest from core.models import ( Bounty, - GroupBounty, - PersonalBounty, TrackedBounty, - GroupData, + RoomData, TrackingData, - UserData, ) @@ -23,12 +20,14 @@ class TestBounty: link="https://github.com/example/repo/issues/1", due_date_ts=1735689600, created_at=1735603200, + created_by_user_id=None, ) assert b.id == 1 assert b.text == "Fix the bug" assert b.link == "https://github.com/example/repo/issues/1" assert b.due_date_ts == 1735689600 assert b.created_at == 1735603200 + assert b.created_by_user_id is None def test_bounty_optional_fields_can_be_none(self): b = Bounty( @@ -37,20 +36,52 @@ class TestBounty: link=None, due_date_ts=None, created_at=0, + created_by_user_id=None, ) assert b.text is None assert b.link is None assert b.due_date_ts is None - def test_bounty_comparison(self): - b1 = Bounty(id=1, text="a", link=None, due_date_ts=None, created_at=0) - b2 = Bounty(id=1, text="a", link=None, due_date_ts=None, created_at=0) + def test_bounty_comparison_equal(self): + b1 = Bounty( + id=1, + text="a", + link=None, + due_date_ts=None, + created_at=0, + created_by_user_id=None, + ) + b2 = Bounty( + id=1, + text="a", + link=None, + due_date_ts=None, + created_at=0, + created_by_user_id=None, + ) assert b1 == b2 + def test_bounty_comparison_not_equal(self): + b1 = Bounty( + id=1, + text="a", + link=None, + due_date_ts=None, + created_at=0, + created_by_user_id=None, + ) + b2 = Bounty( + id=2, + text="b", + link=None, + due_date_ts=None, + created_at=0, + created_by_user_id=None, + ) + assert b1 != b2 -class TestGroupBounty: - def test_create_group_bounty(self): - gb = GroupBounty( + def test_bounty_with_created_by_user_id(self): + b = Bounty( id=1, text="Group task", link=None, @@ -58,43 +89,7 @@ class TestGroupBounty: created_at=0, created_by_user_id=123456, ) - assert gb.id == 1 - assert gb.text == "Group task" - assert gb.created_by_user_id == 123456 - - def test_group_bounty_inherits_from_bounty(self): - gb = GroupBounty( - id=1, - text="Task", - link="https://example.com", - due_date_ts=int(time.time()), - created_at=0, - created_by_user_id=999, - ) - assert isinstance(gb, Bounty) - - -class TestPersonalBounty: - def test_create_personal_bounty(self): - pb = PersonalBounty( - id=1, - text="Personal task", - link=None, - due_date_ts=None, - created_at=0, - ) - assert pb.id == 1 - assert pb.text == "Personal task" - - def test_personal_bounty_inherits_from_bounty(self): - pb = PersonalBounty( - id=1, - text="Task", - link=None, - due_date_ts=None, - created_at=0, - ) - assert isinstance(pb, Bounty) + assert b.created_by_user_id == 123456 class TestTrackedBounty: @@ -109,19 +104,33 @@ class TestTrackedBounty: assert tb1 == tb2 -class TestGroupData: - def test_create_group_data(self): - gd = GroupData( - group_id=-1001, +class TestRoomData: + def test_create_group_room_data(self): + rd = RoomData( + room_id=-1001, + is_group=True, bounties=[], next_id=1, ) - assert gd.group_id == -1001 - assert gd.bounties == [] - assert gd.next_id == 1 + assert rd.room_id == -1001 + assert rd.is_group is True + assert rd.bounties == [] + assert rd.next_id == 1 - def test_group_data_with_bounties(self): - gb = GroupBounty( + def test_create_dm_room_data(self): + rd = RoomData( + room_id=123456, + is_group=False, + bounties=[], + next_id=1, + ) + assert rd.room_id == 123456 + assert rd.is_group is False + assert rd.bounties == [] + assert rd.next_id == 1 + + def test_room_data_with_bounties(self): + b = Bounty( id=1, text="Task", link=None, @@ -129,39 +138,21 @@ class TestGroupData: created_at=0, created_by_user_id=123, ) - gd = GroupData(group_id=-1001, bounties=[gb], next_id=2) - assert len(gd.bounties) == 1 - assert gd.bounties[0].text == "Task" + rd = RoomData(room_id=-1001, is_group=True, bounties=[b], next_id=2) + assert len(rd.bounties) == 1 + assert rd.bounties[0].text == "Task" + assert rd.bounties[0].created_by_user_id == 123 class TestTrackingData: def test_create_tracking_data(self): - td = TrackingData(user_id=123456, tracked=[]) + td = TrackingData(group_id=-1001, user_id=123456, tracked=[]) + assert td.group_id == -1001 assert td.user_id == 123456 assert td.tracked == [] def test_tracking_data_with_tracked(self): tb = TrackedBounty(bounty_id=5, created_at=0) - td = TrackingData(user_id=123, tracked=[tb]) + td = TrackingData(group_id=-1001, user_id=123, tracked=[tb]) assert len(td.tracked) == 1 assert td.tracked[0].bounty_id == 5 - - -class TestUserData: - def test_create_user_data(self): - ud = UserData(user_id=123456, bounties=[], next_id=1) - assert ud.user_id == 123456 - assert ud.bounties == [] - assert ud.next_id == 1 - - def test_user_data_with_bounties(self): - pb = PersonalBounty( - id=1, - text="My task", - link=None, - due_date_ts=None, - created_at=0, - ) - ud = UserData(user_id=123, bounties=[pb], next_id=2) - assert len(ud.bounties) == 1 - assert ud.bounties[0].text == "My task" -- 2.49.1 From 330203e6efeee406711d62a0da11b9ccc338f49a Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:24:12 +0000 Subject: [PATCH 3/4] Address PR #19 review feedback round 2: - Bounty.created_by_user_id is now non-optional (always required) - Removed is_group from RoomData (negative room_id is self-documenting) - Added room_id to TrackedBounty to track which room bounty was tracked from - Added clarifying docstrings explaining TrackingData vs TrackedBounty - Updated tests to match new model structure --- core/models.py | 40 +++++++++++++++++++++++++--------------- tests/test_models.py | 40 +++++++++++++--------------------------- 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/core/models.py b/core/models.py index 12a240d..6f6328c 100644 --- a/core/models.py +++ b/core/models.py @@ -1,53 +1,63 @@ """Domain dataclasses for JIGAIDO bounty tracker.""" from dataclasses import dataclass -from typing import Optional @dataclass class Bounty: - """Bounty - used for both group and personal bounties. + """A bounty created by a user. - Use created_by_user_id to distinguish: if set, it's a group bounty - created by that user. If None, it's a personal/DM bounty. + The created_by_user_id field always refers to the user who created the bounty. + It does NOT indicate whether the bounty is a group or personal bounty. """ id: int - text: Optional[str] - link: Optional[str] - due_date_ts: Optional[int] + text: str | None + link: str | None + due_date_ts: int | None created_at: int - created_by_user_id: Optional[int] = None + created_by_user_id: int @dataclass class TrackedBounty: - """A bounty that a user is tracking.""" + """A bounty that a user is tracking. + + Use TrackedBounty when you need to record that a user is tracking a specific + bounty from a specific room. The room_id indicates which room the bounty + was tracked from (useful when users can track bounties across multiple rooms). + + For simple tracking lists, just use bounty_id and created_at. + """ bounty_id: int created_at: int + room_id: int @dataclass class RoomData: """All data for a room (group or DM). - For groups: is_group=True, room_id is negative (Telegram group ID) - For DMs: is_group=False, room_id is the user_id (positive) - next_id is used to generate unique bounty IDs within this room. + The room_id can be negative for Telegram groups or positive for DMs. + The next_id field is used to generate unique bounty IDs within this room. """ room_id: int - is_group: bool bounties: list[Bounty] next_id: int @dataclass class TrackingData: - """User tracking data within a group. + """User tracking state within a group. - group_id is the Telegram group ID (always negative). + TrackingData vs TrackedBounty: + - Use TrackingData to store ALL tracked bounties for a user in a specific group. + It contains the group_id, user_id, and a list of TrackedBounty entries. + - Use TrackedBounty to represent a single tracked bounty entry within that list. + + TrackingData is the container, TrackedBounty is the item. """ group_id: int diff --git a/tests/test_models.py b/tests/test_models.py index f36843b..7995725 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -20,14 +20,14 @@ class TestBounty: link="https://github.com/example/repo/issues/1", due_date_ts=1735689600, created_at=1735603200, - created_by_user_id=None, + created_by_user_id=123, ) assert b.id == 1 assert b.text == "Fix the bug" assert b.link == "https://github.com/example/repo/issues/1" assert b.due_date_ts == 1735689600 assert b.created_at == 1735603200 - assert b.created_by_user_id is None + assert b.created_by_user_id == 123 def test_bounty_optional_fields_can_be_none(self): b = Bounty( @@ -36,7 +36,7 @@ class TestBounty: link=None, due_date_ts=None, created_at=0, - created_by_user_id=None, + created_by_user_id=123, ) assert b.text is None assert b.link is None @@ -49,7 +49,7 @@ class TestBounty: link=None, due_date_ts=None, created_at=0, - created_by_user_id=None, + created_by_user_id=123, ) b2 = Bounty( id=1, @@ -57,7 +57,7 @@ class TestBounty: link=None, due_date_ts=None, created_at=0, - created_by_user_id=None, + created_by_user_id=123, ) assert b1 == b2 @@ -68,7 +68,7 @@ class TestBounty: link=None, due_date_ts=None, created_at=0, - created_by_user_id=None, + created_by_user_id=123, ) b2 = Bounty( id=2, @@ -76,31 +76,21 @@ class TestBounty: link=None, due_date_ts=None, created_at=0, - created_by_user_id=None, + created_by_user_id=456, ) assert b1 != b2 - def test_bounty_with_created_by_user_id(self): - b = Bounty( - id=1, - text="Group task", - link=None, - due_date_ts=None, - created_at=0, - created_by_user_id=123456, - ) - assert b.created_by_user_id == 123456 - class TestTrackedBounty: def test_create_tracked_bounty(self): - tb = TrackedBounty(bounty_id=5, created_at=1735600000) + tb = TrackedBounty(bounty_id=5, created_at=1735600000, room_id=-1001) assert tb.bounty_id == 5 assert tb.created_at == 1735600000 + assert tb.room_id == -1001 def test_tracked_bounty_comparison(self): - tb1 = TrackedBounty(bounty_id=1, created_at=0) - tb2 = TrackedBounty(bounty_id=1, created_at=0) + tb1 = TrackedBounty(bounty_id=1, created_at=0, room_id=-1001) + tb2 = TrackedBounty(bounty_id=1, created_at=0, room_id=-1001) assert tb1 == tb2 @@ -108,24 +98,20 @@ class TestRoomData: def test_create_group_room_data(self): rd = RoomData( room_id=-1001, - is_group=True, bounties=[], next_id=1, ) assert rd.room_id == -1001 - assert rd.is_group is True assert rd.bounties == [] assert rd.next_id == 1 def test_create_dm_room_data(self): rd = RoomData( room_id=123456, - is_group=False, bounties=[], next_id=1, ) assert rd.room_id == 123456 - assert rd.is_group is False assert rd.bounties == [] assert rd.next_id == 1 @@ -138,7 +124,7 @@ class TestRoomData: created_at=0, created_by_user_id=123, ) - rd = RoomData(room_id=-1001, is_group=True, bounties=[b], next_id=2) + rd = RoomData(room_id=-1001, bounties=[b], next_id=2) assert len(rd.bounties) == 1 assert rd.bounties[0].text == "Task" assert rd.bounties[0].created_by_user_id == 123 @@ -152,7 +138,7 @@ class TestTrackingData: assert td.tracked == [] def test_tracking_data_with_tracked(self): - tb = TrackedBounty(bounty_id=5, created_at=0) + tb = TrackedBounty(bounty_id=5, created_at=0, room_id=-1001) td = TrackingData(group_id=-1001, user_id=123, tracked=[tb]) assert len(td.tracked) == 1 assert td.tracked[0].bounty_id == 5 -- 2.49.1 From b2854393ae5749d00c447f2d41f052bd4d0410a2 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:34:19 +0000 Subject: [PATCH 4/4] Address PR #19 review feedback round 3: - TrackingData.group_id renamed to room_id (works for both group and DM) - Removed room_id from TrackedBounty (it's just a lightweight pointer) --- core/models.py | 16 ++++++---------- tests/test_models.py | 15 +++++++-------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/core/models.py b/core/models.py index 6f6328c..fe57645 100644 --- a/core/models.py +++ b/core/models.py @@ -23,16 +23,12 @@ class Bounty: class TrackedBounty: """A bounty that a user is tracking. - Use TrackedBounty when you need to record that a user is tracking a specific - bounty from a specific room. The room_id indicates which room the bounty - was tracked from (useful when users can track bounties across multiple rooms). - - For simple tracking lists, just use bounty_id and created_at. + Lightweight relation/pointer - the actual tracking context (including room) + lives in TrackingData, not here. """ bounty_id: int created_at: int - room_id: int @dataclass @@ -50,16 +46,16 @@ class RoomData: @dataclass class TrackingData: - """User tracking state within a group. + """User tracking state within a room (group or DM). TrackingData vs TrackedBounty: - - Use TrackingData to store ALL tracked bounties for a user in a specific group. - It contains the group_id, user_id, and a list of TrackedBounty entries. + - Use TrackingData to store ALL tracked bounties for a user in a specific room. + It contains the room_id, user_id, and a list of TrackedBounty entries. - Use TrackedBounty to represent a single tracked bounty entry within that list. TrackingData is the container, TrackedBounty is the item. """ - group_id: int + room_id: int user_id: int tracked: list[TrackedBounty] diff --git a/tests/test_models.py b/tests/test_models.py index 7995725..ca45860 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -83,14 +83,13 @@ class TestBounty: class TestTrackedBounty: def test_create_tracked_bounty(self): - tb = TrackedBounty(bounty_id=5, created_at=1735600000, room_id=-1001) + tb = TrackedBounty(bounty_id=5, created_at=1735600000) assert tb.bounty_id == 5 assert tb.created_at == 1735600000 - assert tb.room_id == -1001 def test_tracked_bounty_comparison(self): - tb1 = TrackedBounty(bounty_id=1, created_at=0, room_id=-1001) - tb2 = TrackedBounty(bounty_id=1, created_at=0, room_id=-1001) + tb1 = TrackedBounty(bounty_id=1, created_at=0) + tb2 = TrackedBounty(bounty_id=1, created_at=0) assert tb1 == tb2 @@ -132,13 +131,13 @@ class TestRoomData: class TestTrackingData: def test_create_tracking_data(self): - td = TrackingData(group_id=-1001, user_id=123456, tracked=[]) - assert td.group_id == -1001 + td = TrackingData(room_id=-1001, user_id=123456, tracked=[]) + assert td.room_id == -1001 assert td.user_id == 123456 assert td.tracked == [] def test_tracking_data_with_tracked(self): - tb = TrackedBounty(bounty_id=5, created_at=0, room_id=-1001) - td = TrackingData(group_id=-1001, user_id=123, tracked=[tb]) + tb = TrackedBounty(bounty_id=5, created_at=0) + td = TrackingData(room_id=-1001, user_id=123, tracked=[tb]) assert len(td.tracked) == 1 assert td.tracked[0].bounty_id == 5 -- 2.49.1