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 ncf helpers #62

Merged
merged 1 commit into from
Jun 20, 2014
Merged

Conversation

VinceMacBuche
Copy link
Member

No description provided.

@@ -220,3 +221,63 @@ def get_all_techniques_metadata(include_methods_calls = True, alt_path = ''):

return all_metadata

def delete_technique_file(technique_name, alt_path=""):
"""Delete a technique directory contained in a path"""
Copy link
Member

Choose a reason for hiding this comment

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

The naming/comments aren't making a whole lot of sense here: delete_file vs "Delete ... directory".

Let's just call this method "delete_technique", and avoid any references to files/directories.

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!

@VinceMacBuche
Copy link
Member Author

all done! Thanks Jon!

raise NcfError(message)

def get_technique_content(technique_metadata):
"""Get technique CFEngine file as string from its metadata"""
Copy link
Member

Choose a reason for hiding this comment

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

s/Get/Build or Generate/

@VinceMacBuche
Copy link
Member Author

updated again!

assert result

def test_default_technique_content(self):

Copy link
Member

Choose a reason for hiding this comment

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

I think it is mandatory in the Python unit testing framework we use to have a """string""" at the beginning of each test function. Either way, it is good practice to describe what the test does here.

VinceMacBuche added a commit that referenced this pull request Jun 20, 2014
@VinceMacBuche VinceMacBuche merged commit 6f0733a into Normation:master Jun 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants