Commit 56844643 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent af23a7b7
......@@ -27,7 +27,7 @@ wcfs.py/wcfs.go while running tox tests in wcfs mode.
from __future__ import print_function, absolute_import
from golang import func, defer
from golang import func, defer, b
from wendelin.wcfs.wcfs_test import tDB, tAt
from wendelin.wcfs import wcfs_test
......@@ -56,8 +56,7 @@ class tMapping(object):
assert t.mmap.blk_start <= blk < t.mmap.blk_stop
blk_inmmap = blk - t.mmap.blk_start
if not isinstance(dataok, bytes):
dataok = dataok.encode('utf-8')
dataok = b(dataok)
fh = t.mmap.fileh
assert len(dataok) <= fh.blksize
dataok += b'\0'*(fh.blksize - len(dataok)) # trailing zeros
......
......@@ -193,6 +193,7 @@ using std::vector;
// trace with op prefix taken from E.
#define etrace(format, ...) trace("%s", v(E(fmt::errorf(format, ##__VA_ARGS__))))
// wcfs::
namespace wcfs {
......
......@@ -46,7 +46,7 @@ from time import gmtime
from errno import EINVAL, ENOENT, ENOTCONN
from stat import S_ISDIR
from signal import SIGQUIT, SIGKILL
from golang import go, chan, select, func, defer, default, error
from golang import go, chan, select, func, defer, default, error, b
from golang import context, errors, sync, time
from zodbtools.util import ashex as h, fromhex
import pytest; xfail = pytest.mark.xfail
......@@ -342,8 +342,7 @@ class tDB(_tDB):
assert isinstance(zf, ZBigFile)
zfDelta = t._changed.setdefault(zf, {})
for blk, data in changeDelta.iteritems():
if not isinstance(data, bytes):
data = data.encode('utf-8')
data = b(data)
assert len(data) <= zf.blksize
zfDelta[blk] = data
......@@ -577,8 +576,7 @@ class tFile:
e.args = (assertCtx + "\n" + e.args[0],)
defer(_)
if not isinstance(dataok, bytes):
dataok = dataok.encode('utf-8')
dataok = b(dataok)
blkdata, _ = t.tdb._blkDataAt(t.zf, blk, t.at)
assert blkdata == dataok, "computed vs explicit data"
t._assertBlk(blk, dataok, pinokByWLink)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment