Add mods per peer review; Added new testing log files to gitignore file;

This commit is contained in:
jfwood
2013-11-26 15:04:35 -06:00
parent 0abd5190f6
commit 537ca7b06e
3 changed files with 12 additions and 22 deletions

2
.gitignore vendored
View File

@@ -25,6 +25,8 @@ pip-log.txt
.coverage
.tox
nosetests.xml
coverage.xml
flake8.log
# pyenv
.python-version

View File

@@ -26,3 +26,13 @@ class BaseEntityManager(object):
for k in dictionary.keys():
if dictionary[k] is None:
dictionary.pop(k)
def total(self):
"""
Returns the total number of entities stored in Barbican.
"""
href = '{0}/{1}'.format(self.api.base_url, self.entity)
params = {'limit': 0, 'offset': 0}
resp = self.api.get(href, params)
return resp['total']

View File

@@ -46,28 +46,6 @@ class FakeResp(object):
return self.content
class SecretData(object):
def __init__(self):
self.name = 'Self destruction sequence'
self.payload = 'the magic words are squeamish ossifrage'
self.payload_content_type = 'text/plain'
self.content = 'text/plain'
self.algorithm = 'AES'
self.created = str(timeutils.utcnow())
self.secret_dict = {'name': self.name,
'status': 'ACTIVE',
'algorithm': self.algorithm,
'created': self.created}
def get_dict(self, secret_ref, content_types_dict=None):
secret_dict = self.secret_dict
secret_dict['secret_ref'] = secret_ref
if content_types_dict:
secret_dict['content_types'] = content_types_dict
return secret_dict
class WhenTestingClientInit(unittest.TestCase):
def setUp(self):
self.auth_endpoint = 'https://localhost:5000/v2.0/'