示例#1
0
def test_truncate():
	K = KVFS(dict())
	K.create("/blub")
	K.write("/blub", "hello world")
	K.truncate("/blub", 5)
	data = K.read("/blub", 10)
	assert data == "hello"
示例#2
0
def test_basic_readwrite():
	msg = "Hello Wörld!"
	K = KVFS(dict())
	K.create("/blub")
	K.write("/blub", msg, 0)
	msg2 = K.read("/blub", len(msg), 0)
	assert msg == msg2, (msg, msg2)
示例#3
0
def test_hardlink():
	msg = "Hello Wörld!"
	K = KVFS(dict())
	K.create("/blub")
	K.write("/blub", msg)
	K.link("/bla", "/blub")
	# This doesn't work if 'write' and 'link' order is changed,
	# but that problem is a deeper one.
	msg2 = K.read("/bla", len(msg))	
	assert msg == msg2, (msg, msg2)
示例#4
0
def test_noexists_read():
	K = KVFS(dict())
	K.read("/blub")
示例#5
0
def test_dirs_read():
	K = KVFS(dict())
	K.mkdir("/blub")
	K.read("/blub")