Skip to content

Commit

Permalink
tests were a bit broken for calendars without mkcalendar.
Browse files Browse the repository at this point in the history
Also added posteo quirks into compatibility_issues
  • Loading branch information
tobixen committed Dec 26, 2023
1 parent d22616a commit c62d7f2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ This project should more or less adhere to [Semantic Versioning](https://semver.
## [1.4.0] - unreleased

* Georges Toth (@sim0nx) did a lot of efforts lifting up the project to more modern standards.
* A hook for collecting debug information has been in the pull request for ages. I've decided to include it in 1.4.0.
* A hook for collecting debug information has been in the pull request queue for ages. I've decided to include it in 1.4.0.

### Fixes

* Code formatting / style fixes.
* Search method did some logic handling non-conformant servers (loading data from the server if the search response didn't include the icalendar data, ignoring trash from the Google server when it returns data without a VTODO/VEVENT/VJOURNAL component.
* Tests - a breakage was introduced for servers not supporting MKCALENDAR - details in https://github.com/python-caldav/caldav/pull/368

### Fixed

Expand All @@ -32,6 +36,7 @@ This project should more or less adhere to [Semantic Versioning](https://semver.
* Remove dependency on pytz. Details in https://github.com/python-caldav/caldav/issues/231
* Use setuptools-scm / pyproject.toml (modern packaging). Details in https://github.com/python-caldav/caldav/pull/364 and https://github.com/python-caldav/caldav/pull/367
* Debugging tool - an environment variable can be set, causing the library to spew out server communications into files under /tmp. Details in https://github.com/python-caldav/caldav/pull/249 and https://github.com/python-caldav/caldav/issues/248
* Comaptibility matrix for posteo.de servers in `tests/compatibility_issues.py`

### Security

Expand All @@ -40,7 +45,7 @@ The debug information gathering hook has been in the limbo for a long time, due
* An attacker that has access to alter the environment the application is running under may cause a DoS-attack, filling up available disk space with debug logging.
* An attacker that has access to alter the environment the application is running under, and access to read files under /tmp (files being 0600 and owned by the uid the application is running under), will be able to read the communication between the server and the client, communication that may be private and confidential.

Thinking it through three times, I'm not too concerned - if someone has access to alter the environment the process is running under and access to read files run by the uid of the application, then this someone should already be trusted and will probably have the possibility to gather this communication through other means.
Thinking it through three times, I'm not too concerned - if someone has access to alter the environment the process is running under and access to read files run by the uid of the application, then this someone should already be trusted and will probably have the possibility to DoS the system or gather this communication through other means.

## [1.3.9] - 2023-12-12

Expand Down
8 changes: 8 additions & 0 deletions tests/compatibility_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,13 @@
'isnotdefined_not_working',
]

posteo = [
'no_scheduling',
'no_mkcalendar',
'no_journal',
'no_recurring_todo',
'no_sync_token',
]


# fmt: on
24 changes: 17 additions & 7 deletions tests/test_caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"ctuid4",
"ctuid5",
"ctuid6",
"tsst1",
"tsst2",
"tsst3",
"tsst4",
"tsst5",
"tsst6",
)
## TODO: todo7 is an item without uid. Should be taken care of somehow.

Expand Down Expand Up @@ -1339,29 +1345,33 @@ def testSearchSortTodo(self):
summary="1 task overdue",
due=date(2022, 12, 12),
dtstart=date(2022, 10, 11),
uid="1",
uid="tsst1",
)
t2 = c.save_todo(
summary="2 task future",
due=datetime.now() + timedelta(hours=15),
dtstart=datetime.now() + timedelta(minutes=15),
uid="2",
uid="tsst2",
)
t3 = c.save_todo(
summary="3 task future due",
due=datetime.now() + timedelta(hours=15),
dtstart=datetime(2022, 12, 11, 10, 9, 8),
uid="3",
uid="tsst3",
)
t4 = c.save_todo(summary="4 task priority low", priority=9, uid="tsst4")
t5 = c.save_todo(
summary="5 task status completed", status="COMPLETED", uid="tsst5"
)
t4 = c.save_todo(summary="4 task priority low", priority=9, uid="4")
t5 = c.save_todo(summary="5 task status completed", status="COMPLETED", uid="5")
t6 = c.save_todo(
summary="6 task has categories", categories="home,garden,sunshine", uid="6"
summary="6 task has categories",
categories="home,garden,sunshine",
uid="tsst6",
)

def check_order(tasks, order):
assert [str(x.icalendar_component["uid"]) for x in tasks] == [
str(x) for x in order
"tsst" + str(x) for x in order
]

all_tasks = c.search(todo=True, sort_keys=("uid",))
Expand Down

0 comments on commit c62d7f2

Please sign in to comment.