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

Fixed matching patterns used for mocking #1470

Merged
merged 1 commit into from
Mar 17, 2021
Merged

Fixed matching patterns used for mocking #1470

merged 1 commit into from
Mar 17, 2021

Conversation

ssbarnea
Copy link
Member

No description provided.

@ssbarnea ssbarnea changed the title Assured we correctly identify FQRN on mocking Fixed matching patterns used for mocking Mar 17, 2021
if re.match(r"\w+\.\w+\.\w+", module_name):
namespace, collection, module_file = module_name.split(".")
path = f"{ options.project_dir }/.cache/collections/ansible_collections/{ namespace }/{ collection }/plugins/modules"
if re.match(r"^(\w+|\w+\.\w+\.[\.\w]+)$", module_name):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if re.match(r"^(\w+|\w+\.\w+\.[\.\w]+)$", module_name):
if re.match(r"^(\w+|\w+\.\w+(\.\w+)+)$", module_name):

Copy link
Member Author

Choose a reason for hiding this comment

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

Based on my tests done on https://regex101.com/ mine example worked as intended but the one with nested matches failed.

Copy link
Contributor

Choose a reason for hiding this comment

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

What exactly did fail? I tried several variants, and they all worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants