def test_mkdir(self): transport = MemoryTransport() transport.mkdir('dir') transport.append_bytes('dir/path', 'content') self.assertEqual(transport.get('dir/path').read(), 'content')
def test_has_present(self): transport = MemoryTransport() transport.append_bytes('foo', 'content') self.assertEquals(True, transport.has('foo'))
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')
def test_mkdir(self): transport = MemoryTransport() transport.mkdir('dir') transport.append_bytes('dir/path', 'content') self.assertEqual(transport.get('dir/path').read(), 'content')
def test_has_present(self): transport = MemoryTransport() transport.append_bytes('foo', 'content') self.assertEquals(True, transport.has('foo'))
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')