Example #1
0
 def test_mkdir(self):
     transport = MemoryTransport()
     transport.mkdir('dir')
     transport.append_bytes('dir/path', 'content')
     self.assertEqual(transport.get('dir/path').read(), 'content')
Example #2
0
 def test_has_present(self):
     transport = MemoryTransport()
     transport.append_bytes('foo', 'content')
     self.assertEquals(True, transport.has('foo'))
Example #3
0
 def test_append_and_get(self):
     transport = MemoryTransport()
     transport.append_bytes('path', 'content')
     self.assertEqual(transport.get('path').read(), 'content')
     transport.append_file('path', StringIO('content'))
     self.assertEqual(transport.get('path').read(), 'contentcontent')
Example #4
0
 def test_mkdir(self):
     transport = MemoryTransport()
     transport.mkdir('dir')
     transport.append_bytes('dir/path', 'content')
     self.assertEqual(transport.get('dir/path').read(), 'content')
Example #5
0
 def test_has_present(self):
     transport = MemoryTransport()
     transport.append_bytes('foo', 'content')
     self.assertEquals(True, transport.has('foo'))
Example #6
0
 def test_append_and_get(self):
     transport = MemoryTransport()
     transport.append_bytes('path', 'content')
     self.assertEqual(transport.get('path').read(), 'content')
     transport.append_file('path', StringIO('content'))
     self.assertEqual(transport.get('path').read(), 'contentcontent')