Skip to content

Commit

Permalink
Add missing tests for parents dir creation
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Mar 12, 2018
1 parent 91d476a commit 2187d4b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_backend_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ def test_open_write_new_file(self, faker):

self.assert_text_equal(filename, content)

def test_open_write_new_file_with_prefix(self, faker):
filename = 'some/new/dir/test.text'
content = six.text_type(faker.sentence())

with self.backend.open(filename, 'w') as f:
f.write(content)

self.assert_text_equal(filename, content)

def test_open_write_new_binary_file(self, faker):
filename = 'test.bin'
content = six.binary_type(faker.binary())
Expand Down Expand Up @@ -106,6 +115,12 @@ def test_write_file(self, faker, utils):

self.assert_bin_equal('test.bin', content)

def test_write_with_prefix(self, faker):
content = six.text_type(faker.sentence())
self.backend.write('some/path/to/test.txt', content)

self.assert_text_equal('some/path/to/test.txt', content)

def test_delete(self, faker):
content = faker.sentence()
self.put_file('file.test', content)
Expand Down

0 comments on commit 2187d4b

Please sign in to comment.