Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.libnetworkcache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.libnetworkcache
Commits
70ec41e1
Commit
70ec41e1
authored
Aug 24, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement negative test for non existence of cache.
parent
9b7aac9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
slapos/libnetworkcachetests.py
slapos/libnetworkcachetests.py
+10
-1
No files found.
slapos/libnetworkcachetests.py
View file @
70ec41e1
...
...
@@ -11,7 +11,7 @@ import tempfile
import
threading
import
time
import
unittest
from
slapos.libnetworkcache
import
NetworkcacheClient
,
UploadError
from
slapos.libnetworkcache
import
NetworkcacheClient
,
UploadError
,
DirectoryNotFound
from
slapos.signature
import
parseArgument
,
\
createPrivateKeyAndCertificateFile
...
...
@@ -207,6 +207,15 @@ class OnlineTest(OnlineMixin, unittest.TestCase):
result
=
nc
.
select
(
key
)
self
.
assertEqual
(
result
.
read
(),
self
.
test_string
)
def
test_upload_shadir_select_not_exists
(
self
):
"""Check scenario with shadir used"""
nc
=
NetworkcacheClient
(
self
.
shacache
,
self
.
shadir
)
urlmd5
=
str
(
random
.
random
())
key
=
'somekey'
+
str
(
random
.
random
())
nc
.
upload
(
self
.
test_data
,
key
,
urlmd5
=
urlmd5
,
file_name
=
'my file'
)
self
.
assertRaises
(
DirectoryNotFound
,
nc
.
select
,
'key_another_key'
+
str
(
random
.
random
()))
def
test_upload_shadir_no_filename
(
self
):
"""Check scenario with shadir used, but not filename passed"""
nc
=
NetworkcacheClient
(
self
.
shacache
,
self
.
shadir
)
...
...
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