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
17be2c49
Commit
17be2c49
authored
Aug 16, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recreate nc object in each test.
parent
57c20a15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
slapos/libnetworkcachetests.py
slapos/libnetworkcachetests.py
+14
-12
No files found.
slapos/libnetworkcachetests.py
View file @
17be2c49
...
@@ -98,8 +98,6 @@ class TestNetworkcacheClient(LibNetworkCacheMixin):
...
@@ -98,8 +98,6 @@ class TestNetworkcacheClient(LibNetworkCacheMixin):
url
=
'http://%s:%s'
%
(
self
.
host
,
self
.
port
)
url
=
'http://%s:%s'
%
(
self
.
host
,
self
.
port
)
self
.
shacache_url
=
url
+
self
.
shacache_path
self
.
shacache_url
=
url
+
self
.
shacache_path
self
.
shadir_url
=
url
+
self
.
shadir_path
self
.
shadir_url
=
url
+
self
.
shadir_path
self
.
nc
=
NetworkcacheClient
(
shacache
=
self
.
shacache_url
,
shadir
=
self
.
shadir_url
)
def
test_init_backward_compatible
(
self
):
def
test_init_backward_compatible
(
self
):
"""Checks that invocation with minimal parameter works fine"""
"""Checks that invocation with minimal parameter works fine"""
...
@@ -112,25 +110,29 @@ class TestNetworkcacheClient(LibNetworkCacheMixin):
...
@@ -112,25 +110,29 @@ class TestNetworkcacheClient(LibNetworkCacheMixin):
"""
"""
Check if the init method is setting the attributes correctly.
Check if the init method is setting the attributes correctly.
"""
"""
nc
=
NetworkcacheClient
(
shacache
=
self
.
shacache_url
,
shadir
=
self
.
shadir_url
)
self
.
assertEquals
({
'Content-Type'
:
'application/json'
},
\
self
.
assertEquals
({
'Content-Type'
:
'application/json'
},
\
self
.
nc
.
shacache_header_dict
)
nc
.
shacache_header_dict
)
self
.
assertEquals
(
self
.
host
,
self
.
nc
.
shacache_host
)
self
.
assertEquals
(
self
.
host
,
nc
.
shacache_host
)
self
.
assertEquals
(
self
.
shacache_path
,
self
.
nc
.
shacache_path
)
self
.
assertEquals
(
self
.
shacache_path
,
nc
.
shacache_path
)
self
.
assertEquals
(
self
.
port
,
self
.
nc
.
shacache_port
)
self
.
assertEquals
(
self
.
port
,
nc
.
shacache_port
)
self
.
assertEquals
(
self
.
shacache_url
,
self
.
nc
.
shacache_url
)
self
.
assertEquals
(
self
.
shacache_url
,
nc
.
shacache_url
)
self
.
assertEquals
({
'Content-Type'
:
'application/json'
},
\
self
.
assertEquals
({
'Content-Type'
:
'application/json'
},
\
self
.
nc
.
shadir_header_dict
)
nc
.
shadir_header_dict
)
self
.
assertEquals
(
self
.
host
,
self
.
nc
.
shadir_host
)
self
.
assertEquals
(
self
.
host
,
nc
.
shadir_host
)
self
.
assertEquals
(
self
.
shadir_path
,
self
.
nc
.
shadir_path
)
self
.
assertEquals
(
self
.
shadir_path
,
nc
.
shadir_path
)
self
.
assertEquals
(
self
.
port
,
self
.
nc
.
shadir_port
)
self
.
assertEquals
(
self
.
port
,
nc
.
shadir_port
)
def
test_signature_creation_without_private_key_file
(
self
):
def
test_signature_creation_without_private_key_file
(
self
):
"""
"""
Without the private key file, it is not possible to create the
Without the private key file, it is not possible to create the
signature so it must return an empty string.
signature so it must return an empty string.
"""
"""
self
.
assertEquals
(
''
,
self
.
nc
.
_getSignatureString
())
nc
=
NetworkcacheClient
(
shacache
=
self
.
shacache_url
,
shadir
=
self
.
shadir_url
)
self
.
assertEquals
(
''
,
nc
.
_getSignatureString
())
def
test_signature_creation_with_private_key_file
(
self
):
def
test_signature_creation_with_private_key_file
(
self
):
"""
"""
...
...
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