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

Commit 11ecdf7

Browse files
kamilbednarzfpedrini
authored andcommitted
Fix paths to files in specs for EncryptedDataBagItem
1 parent 61e039a commit 11ecdf7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chef/tests/test_encrypted_data_bag_item.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from chef import DataBag, EncryptedDataBagItem
22
from chef.exceptions import ChefError, ChefUnsupportedEncryptionVersionError, ChefDecryptionError
3-
from chef.tests import ChefTestCase
3+
from chef.tests import ChefTestCase, TEST_ROOT
44
from chef.api import ChefAPI
55

66
import copy
7+
import os
78

89
class EncryptedDataBagItemTestCase(ChefTestCase):
910
def setUp(self):
@@ -39,7 +40,7 @@ def test_get_version(self):
3940
self.assertRaises(ChefUnsupportedEncryptionVersionError, EncryptedDataBagItem.get_version, {"version": "not a number"})
4041

4142
def test__getitem__(self):
42-
api = ChefAPI('https://chef_test:3000', 'client.pem', 'admin', secret_file='encryption_key')
43+
api = ChefAPI('https://chef_test:3000', os.path.join(TEST_ROOT, 'client.pem'), 'admin', secret_file=os.path.join(TEST_ROOT, 'encryption_key'))
4344
bag = DataBag('test_1')
4445
item = EncryptedDataBagItem(bag, 'test', api, True)
4546
item.raw_data = copy.deepcopy(self.knife_examples)
@@ -57,7 +58,7 @@ def test__getitem__(self):
5758
self.assertRaises(ChefDecryptionError, item.__getitem__, 'pychef_test_ver2')
5859

5960
def test__set_item__(self):
60-
api = ChefAPI('https://chef_test:3000', 'client.pem', 'admin', secret_file='encryption_key')
61+
api = ChefAPI('https://chef_test:3000', os.path.join(TEST_ROOT, 'client.pem'), 'admin', secret_file=os.path.join(TEST_ROOT, 'encryption_key'))
6162
bag = DataBag('test_1')
6263
item = EncryptedDataBagItem(bag, 'test', api, True)
6364
item['id'] = 'test'

0 commit comments

Comments
 (0)