Commit 17be2c49 authored by Łukasz Nowak's avatar Łukasz Nowak

Recreate nc object in each test.

parent 57c20a15
......@@ -98,8 +98,6 @@ class TestNetworkcacheClient(LibNetworkCacheMixin):
url = 'http://%s:%s' % (self.host, self.port)
self.shacache_url = url + self.shacache_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):
"""Checks that invocation with minimal parameter works fine"""
......@@ -112,25 +110,29 @@ class TestNetworkcacheClient(LibNetworkCacheMixin):
"""
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.nc.shacache_header_dict)
self.assertEquals(self.host, self.nc.shacache_host)
self.assertEquals(self.shacache_path, self.nc.shacache_path)
self.assertEquals(self.port, self.nc.shacache_port)
self.assertEquals(self.shacache_url, self.nc.shacache_url)
nc.shacache_header_dict)
self.assertEquals(self.host, nc.shacache_host)
self.assertEquals(self.shacache_path, nc.shacache_path)
self.assertEquals(self.port, nc.shacache_port)
self.assertEquals(self.shacache_url, nc.shacache_url)
self.assertEquals({'Content-Type': 'application/json'}, \
self.nc.shadir_header_dict)
self.assertEquals(self.host, self.nc.shadir_host)
self.assertEquals(self.shadir_path, self.nc.shadir_path)
self.assertEquals(self.port, self.nc.shadir_port)
nc.shadir_header_dict)
self.assertEquals(self.host, nc.shadir_host)
self.assertEquals(self.shadir_path, nc.shadir_path)
self.assertEquals(self.port, nc.shadir_port)
def test_signature_creation_without_private_key_file(self):
"""
Without the private key file, it is not possible to create the
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):
"""
......
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