Allows get sheet or sheet index by sheet name #92
Conversation
try: | ||
self.wb.get_sheet(1.1) | ||
except Exception as e: | ||
self.assertTrue('sheet must be integer or string', e) |
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 isn't asserting what you think it's asserting...
(hint: put e=None
on the line above...)
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.
Sorry, I did not understand what you mean by putting e=None. Why do you think is not asserting?
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.
Then please go and read the documentation for assertTrue so you understand why it's the wrogn assertion method to use here. Hint: your current assertion will always pass. When you write tests, make sure they fail before fixing the code...
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.
You where rigth, my mistake :). I was trying to test the exception message. I'll test only if the exception is raised then.
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.
in test for get sheet by name, arg is an index
in test for get sheet by index, arg is a sheet name
please explain and/or fix
Fixed on last commit. |
Hi,
This pull request is referent to #66, that was closed due lack of feedback. I've made the changes that you requested. Sorry, but I was working in another project.