-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --max-size option to work around Google Calendar limits
https://support.google.com/calendar/answer/45654#zippy=%2Cical-file-file-ends-with-ics says: > Google Calendar only works with files that are one megabyte (1MB) or smaller.
- Loading branch information
Showing
6 changed files
with
76 additions
and
5 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
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
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
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
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
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,33 @@ | ||
from strava_ical.data import Activity | ||
from strava_ical.ical import ical | ||
|
||
|
||
def test_ical(): | ||
activities = [ | ||
Activity({ | ||
'id': 1, | ||
'name': 'Morning Ride', | ||
'distance': 1500, | ||
'total_elevation_gain': 200, | ||
'moving_time': 600, | ||
'elapsed_time': 660, | ||
'start_date': '2024-02-06T10:00:00Z', | ||
'type': 'Ride', | ||
}), | ||
Activity({ | ||
'id': 2, | ||
'name': 'Morning Skate', | ||
'distance': 1500, | ||
'total_elevation_gain': 200, | ||
'moving_time': 600, | ||
'elapsed_time': 660, | ||
'start_date': '2024-02-05T10:00:00Z', | ||
'type': 'InlineSkate', | ||
'start_latlng': [51.0, 0.0], | ||
}), | ||
] | ||
empty_size = len(ical([])) | ||
full_size = len(ical(activities)) | ||
assert empty_size < full_size | ||
assert len(ical(activities, max_size=full_size)) == full_size | ||
assert empty_size < len(ical(activities, max_size=full_size - 1)) < full_size |