Skip to content

Commit

Permalink
Increase coverage for put() as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Harrigan committed Feb 27, 2014
1 parent e32f63b commit bce4d48
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_ftpretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@ def test_list(self):
self.mock_ftp._set_files(['a.txt', 'b.txt'])
self.assertEquals(len(self.pretty.list()), 2)

def test_put(self):
def test_put_filename(self):
size = self.pretty.put('AUTHORS.rst', 'AUTHORS.rst')
self.assertEquals(size, os.path.getsize('AUTHORS.rst'))

def test_put_file(self):
with open('AUTHORS.rst') as file:
size = self.pretty.put(file, 'AUTHORS.rst')
self.assertEquals(size, os.path.getsize('AUTHORS.rst'))

def test_put_contents(self):
size = self.pretty.put(None, 'AUTHORS.rst', 'test string')
self.assertEquals(size, len('test string'))

def test_get(self):
self.mock_ftp._set_contents('hello_get')
Expand Down

0 comments on commit bce4d48

Please sign in to comment.