示例#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')
示例#2
0
 def test_has_present(self):
     transport = MemoryTransport()
     transport.append_bytes('foo', 'content')
     self.assertEquals(True, transport.has('foo'))
示例#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')
示例#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')
示例#5
0
 def test_has_present(self):
     transport = MemoryTransport()
     transport.append_bytes('foo', 'content')
     self.assertEquals(True, transport.has('foo'))
示例#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')