Commit graph

354 commits

Author SHA1 Message Date
samm81
0d741022a9
http: add rate limiting (mainly for google)
- google calendar uses the `403` and `429` codes to perform rate limiting [1][2]. this pr adds `tenacity` to perform exponential back off as suggested in google calendar's docs [3].

[1]: https://developers.google.com/workspace/calendar/api/guides/errors#403_rate_limit_exceeded
[2]: https://developers.google.com/workspace/calendar/api/guides/errors#429_too_many_requests
[3]: https://developers.google.com/workspace/calendar/api/guides/quota#backoff
2025-09-12 16:20:44 +07:00
Hugo Osvaldo Barrera
b5d3b7e578 Apply auto-fixes for RUF rule 2025-08-29 10:17:44 +02:00
Hugo Osvaldo Barrera
9677cf9812 Simplify some statements 2025-08-29 10:17:44 +02:00
Hugo Osvaldo Barrera
20cc1247ed ruff: apply auto-fixes 2025-08-29 10:03:24 +02:00
Mike A.
35f299679f Rewrite guess auth test for unsupported status 2024-09-11 12:04:05 +02:00
Mike A.
67e1c0ded5 Make tests pass 2024-09-11 12:04:05 +02:00
Hugo Osvaldo Barrera
b50f9def00 Ensure type annotations are backwards compatible
Related: https://github.com/pimutils/todoman/issues/544
2023-10-29 16:04:23 +01:00
Hugo Osvaldo Barrera
301aa0e16f pre-commit run --all 2023-09-24 12:41:56 +02:00
Hugo Osvaldo Barrera
24cb49f64c Remove superfluous exception parens 2023-02-10 16:57:39 +01:00
pre-commit-ci[bot]
e11fa357ff [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-07 12:21:17 +01:00
Hugo Osvaldo Barrera
37a7f9bea8 This test is not async 2023-01-31 00:21:04 +01:00
Hugo Osvaldo Barrera
b26e771865 Fix bad syntax for adding finalizers 2022-11-07 17:21:10 +01:00
Hugo Osvaldo Barrera
2fbb0ab7a5 Clean up some invalid TLS configuration branches 2022-09-20 23:01:50 +02:00
Hugo Osvaldo Barrera
60352f84fe Untangle auth handling
This was a bit entangled and messed up due to recent changes.
2022-09-20 23:01:50 +02:00
Hugo Osvaldo Barrera
b61095ad47 Async fixtures must be marked as such
pytest_asyncio now uses strict mode by default.
2022-09-20 23:01:47 +02:00
Hugo Osvaldo Barrera
843c58b92e Ignore flake8-bugbear false positive
See: https://github.com/PyCQA/flake8-bugbear/issues/269
2022-08-09 21:10:17 +02:00
Hugo Osvaldo Barrera
c77d750ef6 Drop etesync
The current [experimental] implementation is stale, and hasn't been
maintained for a long time. Regrettably, not even its tests still work,
and there nobody interested in maintaining it.

If anyone is interested in re-implementing this in a third-party
package, I can consider adding support for pluggable storages.
2021-10-05 22:13:59 +02:00
Hugo Osvaldo Barrera
955f434d9d Also test syncing with an href with a colon
Since this was the actual problematic character.
2021-08-18 18:41:00 +02:00
Hugo Osvaldo Barrera
889183ec89 I think this makes sense 2021-08-18 18:20:04 +02:00
Hugo Osvaldo Barrera
0650cc3bc2 Add test for #918
We're doing something wrong with UID/href quoting/unquoting, but I've
yet to figure out what.
2021-08-18 18:20:04 +02:00
Hugo Osvaldo Barrera
6281e7a237 Radicale now passes for this test 2021-08-18 18:20:04 +02:00
Hugo Osvaldo Barrera
1081a15895 Work around quirk in Fastmail
They seem to sort the parameters in an RRULE in a specific order, so
just use that by default to avoid any mismatch.
2021-08-16 22:29:16 +02:00
Hugo Osvaldo Barrera
fed1ee69c3 Run pyupgrade 2021-08-04 19:58:59 +02:00
Hugo Osvaldo Barrera
7b493416f7
Merge pull request #920 from pimutils/meta_delete
metasync: use None as no-value and delete missing values on syncing
2021-07-26 13:07:45 +02:00
Hugo Osvaldo Barrera
5b8f00e720 Sort imports 2021-07-25 18:35:47 +02:00
Hugo Osvaldo Barrera
7379a96f73 Skip test on unsupported servers 2021-07-23 20:27:34 +02:00
Дилян Палаузов
c0ccb3d1aa metasync: use None as no-value and delete missing values on syncing
- change the interface of Storage.get_meta() and .set_meta()
  to use '' as the empty value and None as missing value.

- When a property is missing (e.g calendar-color was removed)
  in the filesystem storage delete the 'color' file, and
  in the WebDAV storage issue propertyupdate/remove call.

- remove the property from [status]/[pair]/[collection].metadata

I have adjusted, but not run the test suite.  On the other side
I tested on real system: source is CalDAV - destination is filesystem;
and source is CalDAV, destination is CalDAV (another account)
2021-07-23 19:07:02 +02:00
Hugo Osvaldo Barrera
71879045e4 Tidy up test collection creation
- No need to empty collections, they're generated with a UUID and should
  always be empty (the code to empty them does not actually run in CI
  right now).
- Move deletion code to _after_ the yield, since that's the order in
  which things happen.
- Delete all collections asynchronously.
2021-06-27 13:16:31 +02:00
Hugo Osvaldo Barrera
17f422c1b7 Auto-delete test containers 2021-06-26 19:59:56 +02:00
Hugo Osvaldo Barrera
ef2419efa9 Avoid running bogus tests with Fastmail
The fix that disabled VTODO tests accidentally ran all other tests twice
for this storage.

This wasn't picked up earlier since Fastmail is not currently running on
CI.
2021-06-26 18:12:54 +02:00
Hugo Osvaldo Barrera
2eff8e08e1 Fix breakage in Fastmail tests
Some code that wasn't updated with the switch to asyncio.
2021-06-26 18:12:22 +02:00
Hugo Osvaldo Barrera
1a1f6f0788 Initial async support
Add asyncio to the storage backends and most of the codebase. A lot of
it merely uses asyncio APIs, but still doesn't actually run several
things concurrently internally. Further improvements will be added on
top of these changes

Thanks to  Thomas Grainger (@graingert) for a few useful pointers
related to asyncio.
2021-06-26 13:40:35 +02:00
Hugo Osvaldo Barrera
2e4fc7c65a Drop unecessary hypothesis usage
This adds A LOT of time to test execution, for little benefit. While
having random data is good, in reality, most of it was just numbers, and
we rarely got very diverse data.

These hand-picked samples are as good to catch any regressions or issues
with servers.
2021-06-12 18:32:05 +02:00
Hugo Osvaldo Barrera
299c699cb9 Manage test DAV servers as fixtures
Rather than require manually starting them before tests, manage them as
fixtures an initialise/destroy them as needed.
2021-06-12 16:28:24 +02:00
Hugo Osvaldo Barrera
6c80293a98 Mark failing baikal tests as xfail 2021-06-12 13:26:01 +02:00
Hugo Osvaldo Barrera
a9fa61040f Tidy up some collection initializations 2021-06-12 13:23:54 +02:00
Hugo Osvaldo Barrera
eec142ac15 Drop mysteryshack support
It's been unmaintained for years, so no point in keeping track of
compatibility.
2021-06-12 12:06:07 +02:00
Hugo Osvaldo Barrera
91ffb931e1 Move baikal out-of-repo too 2021-06-12 12:06:07 +02:00
Hugo Osvaldo Barrera
bba9d43caf Remove empty install files 2021-06-12 12:06:03 +02:00
Hugo Osvaldo Barrera
d747977af2 Use externally-built containers for test servers
This speeds up CI by avoiding a rebuild of these container on each run.
2021-06-12 10:59:44 +02:00
Hugo Osvaldo Barrera
0e47775ce3 Remove unused submodules
These submodules were used to bootstrap local test servers for running
integration tests.

We'll be reusing that codebase inside docker containers, but don't want
the containers built for each push to this repo -- that'll happen in a
separate repository.
2021-06-12 10:59:44 +02:00
Hugo Osvaldo Barrera
d6c1b1847c Fix a few linting errors 2021-06-12 10:59:44 +02:00
Bernhard Reiter
9b5e01ab38
Improve storage/test_filesystem
with one additional test and fixing of the documentation.
2021-05-20 12:50:05 +02:00
Bernhard Reiter
804b9f0429
Add tests to filesystem storage for file ignorance
that ignore .tmp files even when fileext is empty.
Prepares to make the filesystem storage more universal as part of #881 .
2021-05-19 17:40:04 +02:00
Hugo Osvaldo Barrera
d2d41e5df1 Use black to auto-format the codebase 2021-05-06 19:28:54 +02:00
Hugo Osvaldo Barrera
fdc12d561c Update tests to work with hypothesis 6 2021-04-07 21:45:41 +02:00
Hugo Osvaldo Barrera
2685f8db68 Merge master into dav_default_ns 2021-04-07 08:42:29 +02:00
Hugo Osvaldo Barrera
2161de30d0 Avoid docker-compose
The way it handles docker networks breaks builds.
2021-04-06 19:53:00 +02:00
Дилян Палаузов
bf67af609e Substitute the d: prefix for the DAV: namespace with no prefix (default namespace) 2021-03-09 22:23:12 +02:00
Hugo Osvaldo Barrera
14deb20ce5 Merge remote-tracking branch 'origin/master' into next 2020-06-10 21:10:02 +02:00