Version 1.11.12
[nbdkit/ericb.git] / tests / test.py
blobffe0872639434144eaad34131c3b8bfe36044bb5
1 disk = "\0" * (1024*1024);
3 def config_complete():
4 pass
6 def open(readonly):
7 return 1
9 def get_size(h):
10 global disk
11 return len (disk)
13 def can_write(h):
14 return True
16 def can_flush(h):
17 return True
19 def is_rotational(h):
20 return False
22 def can_trim(h):
23 return True
25 def pread(h, count, offset):
26 global disk
27 return bytearray (disk[offset:offset+count])
29 def pwrite(h, buf, offset):
30 global disk
31 end = offset + len (buf)
32 disk = disk[:offset] + buf + disk[end:]
34 def flush(h):
35 pass
37 def trim(h, count, offset):
38 pass