Skip to content

Add JsonAccessor buffer type tests and improve code quality#2754

Merged
mcosgriff merged 1 commit intomainfrom
added-simple-unit-test-for-json-accessor-type-raw
Jan 23, 2026
Merged

Add JsonAccessor buffer type tests and improve code quality#2754
mcosgriff merged 1 commit intomainfrom
added-simple-unit-test-for-json-accessor-type-raw

Conversation

@mcosgriff
Copy link
Copy Markdown
Contributor

@mcosgriff mcosgriff commented Jan 23, 2026

Add two test cases demonstrating JsonAccessor behavior with different buffer types:

  • Test that writing to empty bytearray raises JSONDecodeError (occurs with inject_tlm type="RAW" without TEMPLATE)
  • Test that writing to dict buffer works correctly (occurs with type="CONVERTED")

Also improve code quality:

  • Replace wildcard imports with specific imports (remove unused unittest.mock and test.test_helper imports)
  • Use assertIsNone() instead of assertEqual(..., None) for better test readability
  • Fix minor formatting inconsistencies

Note: These unit tests came from talk with customer

…lity

Add two test cases demonstrating JsonAccessor behavior with different buffer types:
- Test that writing to empty bytearray raises JSONDecodeError (occurs with inject_tlm type="RAW" without TEMPLATE)
- Test that writing to dict buffer works correctly (occurs with type="CONVERTED")

Also improve code quality:
- Replace wildcard imports with specific imports (remove unused unittest.mock and test.test_helper imports)
- Use assertIsNone() instead of assertEqual(..., None) for better test readability
- Fix minor formatting inconsistencies
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.17%. Comparing base (6511817) to head (9e2c6f9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2754   +/-   ##
=======================================
  Coverage   79.16%   79.17%           
=======================================
  Files         670      670           
  Lines       54278    54278           
  Branches      734      734           
=======================================
+ Hits        42971    42975    +4     
+ Misses      11227    11223    -4     
  Partials       80       80           
Flag Coverage Δ
python 80.97% <ø> (+0.02%) ⬆️
ruby-api 83.65% <ø> (ø)
ruby-backend 82.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcosgriff mcosgriff merged commit 7f1bdd9 into main Jan 23, 2026
29 of 30 checks passed
@mcosgriff mcosgriff deleted the added-simple-unit-test-for-json-accessor-type-raw branch January 23, 2026 20:06
jmthomas pushed a commit that referenced this pull request Mar 21, 2026
…lity (#2754)

Add two test cases demonstrating JsonAccessor behavior with different buffer types:
- Test that writing to empty bytearray raises JSONDecodeError (occurs with inject_tlm type="RAW" without TEMPLATE)
- Test that writing to dict buffer works correctly (occurs with type="CONVERTED")

Also improve code quality:
- Replace wildcard imports with specific imports (remove unused unittest.mock and test.test_helper imports)
- Use assertIsNone() instead of assertEqual(..., None) for better test readability
- Fix minor formatting inconsistencies
jmthomas pushed a commit that referenced this pull request Mar 21, 2026
…lity (#2754)

Add two test cases demonstrating JsonAccessor behavior with different buffer types:
- Test that writing to empty bytearray raises JSONDecodeError (occurs with inject_tlm type="RAW" without TEMPLATE)
- Test that writing to dict buffer works correctly (occurs with type="CONVERTED")

Also improve code quality:
- Replace wildcard imports with specific imports (remove unused unittest.mock and test.test_helper imports)
- Use assertIsNone() instead of assertEqual(..., None) for better test readability
- Fix minor formatting inconsistencies
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.

2 participants