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

Test/create tests for json_to_timeseries #10

Merged
merged 19 commits into from
Dec 30, 2022

Conversation

mnbf9rca
Copy link
Owner

No description provided.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 30, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 1.65%.

Quality metrics Before After Change
Complexity 1.83 ⭐ 1.40 ⭐ -0.43 👍
Method Length 39.20 ⭐ 42.51 ⭐ 3.31 👎
Working memory 5.36 ⭐ 4.96 ⭐ -0.40 👍
Quality 84.91% 86.56% 1.65% 👍
Other metrics Before After Change
Lines 779 747 -32
Changed files Quality Before Quality After Quality Change
shared_code/__init__.py % % %
shared_code/emon.py 76.02% ⭐ 82.36% ⭐ 6.34% 👍
shared_code/glow.py 68.16% 🙂 69.41% 🙂 1.25% 👍
shared_code/helpers.py 82.03% ⭐ 84.28% ⭐ 2.25% 👍
shared_code/homie.py 72.67% 🙂 74.12% 🙂 1.45% 👍
shared_code/timeseries.py 74.22% 🙂 74.22% 🙂 0.00%
test/test_shared_code.py 90.81% ⭐ 89.79% ⭐ -1.02% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
shared_code/timeseries.py create_record_recursive 15 🙂 104 🙂 10 😞 54.40% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@github-actions
Copy link

github-actions bot commented Dec 30, 2022

Coverage report

The coverage rate went from 100% to 100% ➡️
The branch rate is 100%.

100% of new lines are covered.

Diff Coverage details (click to unfold)

shared_code/init.py

100% of new lines are covered (100% of the complete file).

shared_code/helpers.py

100% of new lines are covered (100% of the complete file).

shared_code/emon.py

100% of new lines are covered (100% of the complete file).

shared_code/timeseries.py

100% of new lines are covered (100% of the complete file).

shared_code/homie.py

100% of new lines are covered (100% of the complete file).

json_to_timeseries/init.py

100% of new lines are covered (100% of the complete file).

shared_code/glow.py

100% of new lines are covered (100% of the complete file).

@mnbf9rca mnbf9rca merged commit 355c89f into main Dec 30, 2022
@mnbf9rca mnbf9rca deleted the test/create-tests-for-json-to-timeseries branch December 30, 2022 13:43
mnbf9rca added a commit that referenced this pull request Oct 27, 2023
* linting

* validate to_datetime returns a string

* rename json-to-timeseries to json_to_timeseries so it can be imported

* oops

* add message body encoding in UTF-8 because Azure does

* test parse_message and send_to_converter

* fix vscode debugging when pytest-cov is installed https://code.visualstudio.com/docs/python/testing#_debug-tests

* export test deps. on commit

* test-requirements, not dev-requirements

* add comment to get_record_type bool

* test json_to_timescale main

* rename test to match module

* test extract_topic

* fix tests by correcting overlapping method names

* 'Refactored by Sourcery' (#11)

Co-authored-by: Sourcery AI <>

* finish tests for json_to_timeseries

* split tests for test_data.py to separate file

* rename test_data.py to get_test_data.py

* test create_event_hub_event, extract create_correlation_id

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
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.

1 participant