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

Python TemplateAccessor and CmdResponseProtocol #1684

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

ryanmelt
Copy link
Member

@ryanmelt ryanmelt commented Nov 1, 2024

No description provided.

@ryanmelt ryanmelt requested a review from jmthomas November 1, 2024 02:46
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.52%. Comparing base (500f7db) to head (931f66a).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1684      +/-   ##
==========================================
+ Coverage   76.48%   76.52%   +0.04%     
==========================================
  Files         618      620       +2     
  Lines       46929    47094     +165     
  Branches      850      850              
==========================================
+ Hits        35892    36038     +146     
- Misses      10941    10961      +20     
+ Partials       96       95       -1     
Flag Coverage Δ
frontend 55.97% <ø> (+0.06%) ⬆️
python 83.97% <ø> (+0.01%) ⬆️
ruby-api 48.74% <ø> (ø)
ruby-backend 82.52% <ø> (+<0.01%) ⬆️

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.

escaped_right_char = f"\\{self.right_char}"

# Convert the template into a Regexp for reading each item
template = self.packet.template[:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just add .decode() here and do it once

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

if self.left_char == "(":
item = f"\({item[1:]}"
if self.right_char == ")":
item = f"{item[0:-1]}\)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At line 34 and 37 it is a double \\ but here a single \(. Is that correct? Ruby has double \\.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. One is for a regex and the other is for a string replace

if values is not None:
num_items = len(values)
raise RuntimeError(
f"Unexpected number of items found in buffer= {num_items}, Expected= {len(self.item_keys)}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby code is buffer: and Expected:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if values is not None:
num_items = len(values)
raise RuntimeError(
f"Unexpected number of items found in buffer= {num_items}, Expected= {len(self.item_keys)}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change = to :

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link

sonarqubecloud bot commented Nov 1, 2024

@jmthomas jmthomas self-requested a review November 1, 2024 22:20
@ryanmelt ryanmelt merged commit 74aa4b7 into main Nov 8, 2024
27 checks passed
@ryanmelt ryanmelt deleted the python_cmd_response_protocol_and_template_accessor branch November 8, 2024 04:11
@jmthomas jmthomas mentioned this pull request Dec 9, 2024
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