Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/18-task-sel-filt into develop #32

Merged
merged 23 commits into from
Oct 26, 2021

Conversation

JonathanCasey
Copy link
Owner

This adds the functionality to get tasks from the asana API and to filter them based on due date/time and completion status. A few other tweaks needed to be made along the way on this adventure though...

  • Added an is_date_only() checker.
  • assumed time for min/max due added to rules.conf for MoveTasksRule, with notes on how to use it.
    • parse_time_arg() added to Rule to support parsing the new arg.
  • An empty string for timeframe config arg now returns None rather than an empty relativedelta().
  • fixture_sections_in_utl_test() moved from /tests/unit/asana/test_client.py to new /tests/unit/asana/conftest.py so it can be used by multiple modules in that subpackage.
  • _TASK_TEMPLATE added to tester_date.
  • /asana_extensions/general/utils.py added, with corresponding unit test module.
  • Some small tweaks to error messages.

...and so much more...

Closes #18.

…na_error_handler` test list, started first case of test.

- Also added utl sections and tasks fixtures (with some small changes to old fixtures).
- Also added `_TASK_TEMPLATE` to `tester_data`.
…tils`. No tests yet. Also added new `general/utils.py`, with `is_date_only()` checker (with unit test).
…me differently based on whether it is a greater than/eq or a less than/eq check.
…is issue); added `use_tzinfo` (rules config change coming NOT in this issue, if ever); timezone factored in for date-only to differentiate between target timezone and machine timezone; assumed time added if time duration provided; fixed missing logic in detecting date-only `relativedelta`; unit test for `_filter_tasks_by_datetime()` started, working so far...
…r `_filter_tasks_by_datetime()` finished, with some reordering and extras added to make it easier to use. ...now let's never think about timezones ever again.
…o due date cases covered. Added error message to assertion. `fixture_sections_in_utl_test()` moved to new `/tests/unit/asana/conftest.py` so can be shared with modules in `/test/unit/asana`, allowing `fixture_tasks_with_due_in_utl_test()` to be added.
… off!). Changed how filtered test results are compared (but no new test cases yet).
…arg to that function for unit test purposes.
…s_by_completed()` added, arg added to `get_filtered_tasks()`, all unit tests complete.
…ring to maximize compatibility with this code.
…stead of `only use datetime field`. Added reading and checking of these options in `MoveTasksRule`, with `parse_time_arg()` method added and `config.UnsupportedFormatError` added to support.
…w cases for new keys. Also made `test-move-tasks-full` a test by itself without counting on it filling in for a specific case -- duplicates, but easier to see. Some small tweaks to error messages.
@JonathanCasey JonathanCasey added this to the v1.0.0 milestone Oct 24, 2021
… to use `use_tzinfo` for most tests. Hopefully successfully added another test case that will work regardless of timezone while testing the omission of the `use_tzinfo` arg...
@codecov
Copy link

codecov bot commented Oct 24, 2021

Codecov Report

Merging #32 (270ae32) into develop (db2f41b) will decrease coverage by 0.23%.
The diff coverage is 98.93%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #32      +/-   ##
===========================================
- Coverage   100.00%   99.76%   -0.24%     
===========================================
  Files           12       13       +1     
  Lines          341      433      +92     
===========================================
+ Hits           341      432      +91     
- Misses           0        1       +1     
Impacted Files Coverage Δ
asana_extensions/general/__init__.py 100.00% <ø> (ø)
asana_extensions/asana/utils.py 98.88% <97.82%> (-1.12%) ⬇️
asana_extensions/asana/client.py 100.00% <100.00%> (ø)
asana_extensions/general/config.py 100.00% <100.00%> (ø)
asana_extensions/general/utils.py 100.00% <100.00%> (ø)
asana_extensions/rules/move_tasks_rule.py 100.00% <100.00%> (ø)
asana_extensions/rules/rule_meta.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db2f41b...270ae32. Read the comment docs.

…ure of codecov miss...tested to confirm definitely hitting the line it complained about...
@JonathanCasey
Copy link
Owner Author

Not fixing code coverage on this PR -- will leave failing. Will be fixed in #33.

@JonathanCasey JonathanCasey merged commit 6565c3e into develop Oct 26, 2021
@JonathanCasey JonathanCasey deleted the feature/18-task-sel-filt branch October 26, 2021 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add task select / filtering
1 participant