Changeset View
Changeset View
Standalone View
Standalone View
tests/unit/test-011-wallace_resources.py
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | def setUp(self): | ||||
self.smtplog = []; | self.smtplog = []; | ||||
def _mock_nop(self, domain=None): | def _mock_nop(self, domain=None): | ||||
pass | pass | ||||
def _mock_find_resource(self, address): | def _mock_find_resource(self, address): | ||||
if not 'resource' in address: | if not 'resource' in address: | ||||
return None | return []; | ||||
(prefix, domain) = address.split('@') | (prefix, domain) = address.split('@') | ||||
entry_dn = "cn=" + prefix + ",ou=Resources,dc=" + ",dc=".join(domain.split('.')) | entry_dn = "cn=" + prefix + ",ou=Resources,dc=" + ",dc=".join(domain.split('.')) | ||||
return [ entry_dn ]; | return [ entry_dn ]; | ||||
def _mock_get_entry_attributes(self, domain, entry, attributes): | def _mock_get_entry_attributes(self, domain, entry, attributes): | ||||
(_, uid) = entry.split(',')[0].split('=') | (_, uid) = entry.split(',')[0].split('=') | ||||
return { 'cn': uid, 'mail': uid + "@example.org", '_attrib': attributes } | return { 'cn': uid, 'mail': uid + "@example.org", '_attrib': attributes } | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |