-
Notifications
You must be signed in to change notification settings - Fork 5
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
Pr 4 #4
base: master
Are you sure you want to change the base?
Pr 4 #4
Conversation
for filename in files: | ||
if filename.endswith(".xml"): | ||
xml_file = filename | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want to change this for a scenario where there are more than one xml files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion, Sara!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome job
assert find_xml_file(".") is None | ||
|
||
|
||
def test_finds_existing_xml_file(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good work defining a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks fine
from find_xml_file.find_xml_file import find_xml_file | ||
|
||
|
||
def test_no_files_returns_None(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we testing for a specific file? It might be helpful to be more descriptive here. "test_no_xml_files_returns_None():"
xml_file = filename | ||
break | ||
|
||
return xml_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there only one xml file anticipated. What if there is more than one.
import os | ||
|
||
|
||
def find_xml_file(folder): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the instance of more than one xml files?
@@ -0,0 +1,10 @@ | |||
from find_xml_file.find_xml_file import find_xml_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This naming could be confusing. Can we rename these files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a great suggestion, Dani!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is only one method in file, maybe we can leave this as is OR rename the file where the method lives, so its is not redundant.
def find_xml_file(folder): | ||
files = os.listdir(folder) | ||
|
||
xml_file = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need to be renamed xml_files if we are going to possibly grab more than one.
|
||
xml_file = None | ||
|
||
for filename in files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great use of a for loop!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming conventions
|
||
|
||
def find_xml_file(folder): | ||
files = os.listdir(folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we try to find a more descriptive variable name like user_files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up naming conventions if we collect more than one xml file.
No description provided.