Added test cases.

Added test case that doesn't use local file, and passed the tests. New
test cases passes binary data and io.BytesIO instance to functions.