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)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user