Commit Graph

7 Commits

Author SHA1 Message Date
Simone Robutti a0a1d43fa0
rework config (#121)
* simplified config behavior

* temp

* removed redundant tests

* removed publication window

* removed settings_file cli option

* add pre_test code, in order to set environment variables

* Revert "add pre_test code, in order to set environment variables"

This reverts commit 0d25f9313a.

Co-authored-by: magowiz <magowiz@gmail.com>
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2022-01-08 00:54:27 +01:00
Simone Robutti 360740eae0
format event cli (#61)
* added get_formatted_event

* fixed cli settings

* added format command

* refactored inspect
2021-09-09 23:04:19 +02:00
tinoilcotechino 394d84b0a5
settings.toml: Move secrets to dedicated file. (#60)
Configuration files are checked in this order:

      1. CLI argument
      2. `$MOBILIZION_RESHARE_SETTINGS_FILE` environment variable;
      3. User configuration directory. On Linux that's `$XDG_CONFIG_HOME/mobilizon_reshare/<mobilizon-reshare-version>`;
      4. System configuration directory. On Linux that's the first element in `$XDG_CONFIG_DIRS` + `/mobilizon_reshare/<mobilizon-reshare-version>`.
      5. The default configuration distributed with the package.

The first available configuration file will be loaded. Secrets can be set either
via environment variables (such as `export MOBILIZON_RESHARE_PUBLISHER_TELEGRAM_TOKEN="my-telegram-token"` )
or by setting the `$SECRETS_FOR_DYNACONF` environment variable to a `secrets.(toml|yaml|ini|json)` file.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-09-07 23:39:58 +02:00
Simone Robutti 8a27de8981
add tests (#44)
* fixed test_window_no_event

* added strategy tests

* removed unused code

* added config tests

* added more config tests

* refactored tests

* updated pytest
2021-07-18 18:23:30 +02:00
Simone Robutti a33a1d7b3e removed duplicated settings 2021-07-08 10:31:28 +02:00
Simone Robutti 40919a994f
publication window (#24)
* added get events stub

* added event parsing

* removed datetime

* added config and tests

* fixed response format in test

* more tests

* added error handling for request

* improved dummy data

* added get_unpublished_events

* added test

* removed last_accessed

* mobilizon_url moved to fixture

* added config comments

* moved mobilizon group to config

* added method

* removed non-working test settings

* added publishing window logic and tests

* added inner/outer window check and mocking

* improved fixture

* fixed outer window

* fixed tests
2021-07-07 11:19:37 +02:00
Simone Robutti fcd5116d1c
download events (#19)
* added get events stub

* added event parsing

* removed datetime

* added config and tests

* fixed response format in test

* more tests

* added error handling for request

* improved dummy data

* added get_unpublished_events

* added test

* removed last_accessed

* mobilizon_url moved to fixture

* added config comments

* moved mobilizon group to config
2021-05-30 21:47:36 +02:00