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

Add pad-array protocol #1266

Merged
merged 8 commits into from
Oct 4, 2023
Merged

Add pad-array protocol #1266

merged 8 commits into from
Oct 4, 2023

Conversation

jmosbacher
Copy link
Contributor

Adds a URLConfig protocol wich will pad an array on the left or right or both with a configurable number of elements of the specified value

The protocol accepts the arguments pad_left, pad_right and pad_value to specify how many elements to add and what value to fill them with.

tests/test_url_config.py Outdated Show resolved Hide resolved
tests/test_url_config.py Show resolved Hide resolved
@@ -391,3 +391,10 @@ def test_run_doc_protocol(self):
self.st.set_config({ 'test_config': "run_doc://mode?run_id=plugin.run_id" })
p = self.st.get_single_plugin(999999999, 'test_data')
return p.test_config

def test_pad_array(self):
self.st.set_config({'test_config': 'pad-array://json://[1,2,3]?pad_left=2&pad_right=3&pad_value=0'})

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
E501 line too long (108 > 100 characters)

@coveralls
Copy link

coveralls commented Sep 14, 2023

Coverage Status

coverage: 93.696% (+0.02%) from 93.673% when pulling c6553df on pad_array_protocol into 9bf6192 on master.

@WenzDaniel
Copy link
Collaborator

Looks good. Thanks for the quick implementation.

WenzDaniel
WenzDaniel previously approved these changes Sep 18, 2023
@LuisSanchez25
Copy link
Contributor

I was trying to test this protocol but I am a bit confused as to why it is in the xe1t_url_config and not in the normal url_config file, is there something I am missing here?

@LuisSanchez25
Copy link
Contributor

I successfully used the protocol to process some nv records so this is ready to be merged

@jmosbacher
Copy link
Contributor Author

@LuisSanchez25 If you tested this, can you add your review? thanks.

@LuisSanchez25 LuisSanchez25 self-requested a review September 26, 2023 15:58
@cwittweg cwittweg merged commit 84317ad into master Oct 4, 2023
@dachengx dachengx deleted the pad_array_protocol branch October 4, 2023 19:17
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.

5 participants