summaryrefslogtreecommitdiffstats
path: root/combox/tests/test_file.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2014-10-30 11:36:49 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2014-10-30 11:36:49 -0400
commitf47f4e21067342c0b90b185e8eeeab8003a81e59 (patch)
tree54f8398b84cea045b1c5f94288ba453a75771448 /combox/tests/test_file.py
parent4caa09b8093eec6919fccd8e2296430a17593d68 (diff)
updated combox/file.py: renamed split_file -> split_data and glue_file -> glue_data
split_data: reads a string or a stream of bytes and splits them into `n' parts. glue_data: reads an array of strings / stream of bytes and glues them into one string / stream of bytes. read_file: reads content from file and returns it. --- "Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we're looking for more people with skills in this language." said Peter Norvig, director of search quality at Google, Inc. --- Google has employed a Gingrich-era Republican as its head lobbyist in DC. Now, Google is effectively helping Comcast kill the Internet as we know it, and end "Net Neutrality" forever. -- SumOfUs.org Sign a petition to ask Google to stand up for Net Neutrality: http://action.sumofus.org/a/googlesupportnn/
Diffstat (limited to 'combox/tests/test_file.py')
-rw-r--r--combox/tests/test_file.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/combox/tests/test_file.py b/combox/tests/test_file.py
index 08d0d85..bfd1d9c 100644
--- a/combox/tests/test_file.py
+++ b/combox/tests/test_file.py
@@ -18,12 +18,13 @@
from os import path
-from file import split_file, glue_file, write_file
+from file import split_data, glue_data, write_file, read_file
### Test to split, glue and create a copy of the image file from the
### glued image file.
f = path.abspath('tests/files/the-red-star.jpg')
+f_content = read_file(f)
+f_parts = split_data(f_content, 5)
+f_content = glue_data(f_parts)
f_copy = path.abspath('tests/files/the-red-star-copy.jpg')
-f_parts = split_file(f, 3)
-filecontent = glue_file(f_parts)
-write_file(f_copy, filecontent)
+write_file(f_copy, f_content)