Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
16dea9d0
Commit
16dea9d0
authored
Mar 13, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6ffc9a52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+11
-11
No files found.
wcfs/wcfs_test.py
View file @
16dea9d0
...
...
@@ -161,26 +161,26 @@ class tDB:
# path returns path for object on wcfs.
# - str: wcfs root + obj;
# - Persistent: wcfs root + (head|@<
rev
>)/bigfile/obj
def
path
(
t
,
obj
,
rev
=
None
):
# - Persistent: wcfs root + (head|@<
at
>)/bigfile/obj
def
path
(
t
,
obj
,
at
=
None
):
if
isinstance
(
obj
,
Persistent
):
head
=
"head/"
if
rev
is
None
else
(
"@%s/"
%
h
(
rev
))
head
=
"head/"
if
at
is
None
else
(
"@%s/"
%
h
(
at
))
obj
=
"%s/bigfile/%s"
%
(
head
,
h
(
obj
.
_p_oid
))
rev
=
None
at
=
None
assert
isinstance
(
obj
,
str
)
assert
rev
is
None
# must not be used with str
assert
at
is
None
# must not be used with str
return
os
.
path
.
join
(
t
.
wc
.
mountpoint
,
obj
)
# read reads file corresponding to obj on wcfs
def
read
(
t
,
obj
,
rev
=
None
):
path
=
t
.
path
(
obj
,
rev
=
rev
)
def
read
(
t
,
obj
,
at
=
None
):
path
=
t
.
path
(
obj
,
at
=
at
)
return
readfile
(
path
)
# stat stats file corresponding to obj on wcfs
def
stat
(
t
,
obj
,
rev
=
None
):
path
=
t
.
path
(
obj
,
rev
=
rev
)
def
stat
(
t
,
obj
,
at
=
None
):
path
=
t
.
path
(
obj
,
at
=
at
)
return
os
.
stat
(
path
)
...
...
@@ -277,12 +277,12 @@ def test_wcfs():
# f @tcommit1
st
=
t
.
stat
(
f
,
rev
=
tcommit1
)
st
=
t
.
stat
(
f
,
at
=
tcommit1
)
assert
st
.
st_size
==
fsize1
#assert st.st_mtime == tidtime(tcommit1) FIXME mtime for @revX -> = revX ?
#assert readfile(fpath + "/at") == h(tcommit1) XXX do we need it?
data
=
t
.
read
(
f
,
rev
=
tcommit1
)
data
=
t
.
read
(
f
,
at
=
tcommit1
)
assert
len
(
data
)
==
fsize1
for
i
in
range
(
hole
):
assert
data
[
i
*
blksize
:(
i
+
1
)
*
blksize
]
==
b'
\
0
'
*
blksize
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment