Skip to content

Commit 7fcc193

Browse files
committed
Merge in #563 as needed by certain WiP edit_user and delete_user unit tests.
1 parent ee23634 commit 7fcc193

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

tests/support/usersupp.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939

4040
TEST_USER_DN = '/C=DK/ST=NA/L=NA/O=Test Org/OU=NA/CN=Test User/emailAddress=test@example.com'
41+
OTHER_USER_DN = '/C=DK/ST=NA/L=NA/O=Other Org/OU=NA/CN=Other User/emailAddress=other@example.com'
42+
NO_SUCH_USER_DN = '/C=DK/ST=NA/L=NA/O=No Such Org/OU=NA/CN=No Such User/emailAddress=nosuchuser@example.com'
4143

4244
_FIXTURE_NAME_BY_USER_DN = {
4345
TEST_USER_DN: 'MiG-users.db--example'
@@ -120,6 +122,15 @@ def _provision_test_user_dirs(testcase, distinguished_name):
120122
with open(test_user_settings_file, 'wb') as outfile:
121123
pickle.dump({}, outfile)
122124

125+
# create the test user cache, resource pending and mrsl files sub dirs
126+
for sub in (self.configuration.user_cache,
127+
self.configuration.resource_pending,
128+
self.configuration.mrsl_files_dir):
129+
conf_user_sub = os.path.normpath(sub)
130+
test_user_sub_dir = os.path.join(
131+
conf_user_sub, test_client_dir_name)
132+
os.makedirs(test_user_sub_dir)
133+
123134
return test_user_dir
124135

125136
@staticmethod
@@ -134,8 +145,8 @@ def _provision_test_users(testcase, *distinguished_names):
134145
that the user db will be populated from arbitrary data and thus
135146
the test dependent upon this is less strongly assured, but if
136147
(as is the expectation) the basic operations are validated with
137-
"indenpdent" data i.e. conained within fixtures as opposed to
138-
generated by logic that extended tests which need
148+
"independent" data i.e. contained within fixtures as opposed to
149+
generated by logic that extended tests will need.
139150
"""
140151

141152
conf_user_db_home = UserAssertMixin._provision_user_db_dir(testcase)

0 commit comments

Comments
 (0)