Skip to content
This repository was archived by the owner on May 9, 2020. It is now read-only.

Commit 734e886

Browse files
committed
Merge pull request #37 from astryia/fix_tests
Tests were fixed
2 parents e42a551 + 7cf353e commit 734e886

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

chef/client.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def _populate(self, data):
1212
if self.platform:
1313
self.orgname = data.get('orgname')
1414
self.validator = bool(data.get('validator', False))
15-
self.public_key = data.get('certificate')
15+
self.public_key = data.get('public_key')
1616
self.admin = False
1717
else:
1818
self.admin = bool(data.get('admin', False))
@@ -31,7 +31,7 @@ def to_dict(self):
3131
d.update({
3232
'orgname': self.orgname,
3333
'validator': self.validator,
34-
'certificate': self.certificate,
34+
'public_key': self.certificate,
3535
'clientname': self.name,
3636
})
3737
else:
@@ -48,6 +48,7 @@ def create(cls, name, api=None, admin=False):
4848
obj.admin = admin
4949
d = api.api_request('POST', cls.url, data=obj)
5050
obj.private_key = d['private_key']
51+
obj.public_key = d['public_key']
5152
return obj
5253

5354
def rekey(self, api=None):

chef/tests/test_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_basic(self):
1717
def test_current_dir(self):
1818
api = self.load('current_dir.rb')
1919
path = os.path.join(os.path.dirname(__file__), 'configs', 'test_1')
20-
self.assertEqual(api.client, path)
20+
self.assertEqual(os.path.normpath(api.client), path)
2121

2222
def test_env_variables(self):
2323
try:

chef/tests/test_client.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,21 @@ def test_get(self):
1515
self.assertTrue(client.certificate)
1616
self.assertEqual(client.private_key, None)
1717

18-
@unittest2.skip('Unknown failure, skipping until tomorrow morning <NPK 2012-03-22>')
1918
def test_create(self):
2019
name = self.random()
2120
client = Client.create(name)
2221
self.register(client)
2322
self.assertEqual(client.name, name)
2423
#self.assertEqual(client.orgname, 'pycheftest') # See CHEF-2019
2524
self.assertTrue(client.private_key)
26-
25+
self.assertTrue(client.public_key)
2726
self.assertIn(name, Client.list())
2827

2928
client2 = Client(name)
3029
client2.rekey()
30+
self.assertEqual(client.public_key, client2.public_key)
3131
self.assertNotEqual(client.private_key, client2.private_key)
3232

33-
@unittest2.skip('Unknown failure, skipping until tomorrow morning <NPK 2012-03-22>')
3433
def test_delete(self):
3534
name = self.random()
3635
client = Client.create(name)

0 commit comments

Comments
 (0)