Ejemplo n.º 1
0
 def test_get_mailing_list_member(self):
     """Retrieve mailing list member; retrieve list member object."""
     member = SpokeMailingListMember(self.org_name, self.list_address)
     result = member.get(self.list_member)['data']
     
     list_name, list_domain = self.list_address.split('@')
     rdn = '%s=%s' % (self.list_key, list_name)
     container = '%s=%s' % (self.container_attr, self.list_container)
     base_dn = '%s,%s=%s,%s' % (container, self.org_attr,
                                self.org_name, self.base_dn)
     dn = '%s,%s' % (rdn, base_dn)
     dn_info = {self.list_destination_attr:[self.list_member]}
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)
Ejemplo n.º 2
0
    def test_get_mailing_list_member(self):
        """Retrieve mailing list member; retrieve list member object."""
        member = SpokeMailingListMember(self.org_name, self.list_address)
        result = member.get(self.list_member)['data']

        list_name, list_domain = self.list_address.split('@')
        rdn = '%s=%s' % (self.list_key, list_name)
        container = '%s=%s' % (self.container_attr, self.list_container)
        base_dn = '%s,%s=%s,%s' % (container, self.org_attr, self.org_name,
                                   self.base_dn)
        dn = '%s,%s' % (rdn, base_dn)
        dn_info = {self.list_destination_attr: [self.list_member]}
        expected_result = [(dn, dn_info)]
        self.assertEqual(result, expected_result)
Ejemplo n.º 3
0
 def test_get_all_mailing_list_members(self):
     """Retrieve all list members; retrieve list of member objects."""
     member_address = '*****@*****.**'
     member = SpokeMailingListMember(self.org_name, self.list_address)
     member.create(member_address)
     result = member.get(member_address)['data']
     
     list_name, list_domain = self.list_address.split('@')
     rdn = '%s=%s' % (self.list_key, list_name)
     container = '%s=%s' % (self.container_attr, self.list_container)
     base_dn = '%s,%s=%s,%s' % (container, self.org_attr,
                                self.org_name, self.base_dn)
     dn = '%s,%s' % (rdn, base_dn)
     dn_info = {
                self.list_destination_attr:[self.list_member,member_address]
                }
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)
Ejemplo n.º 4
0
    def test_get_all_mailing_list_members(self):
        """Retrieve all list members; retrieve list of member objects."""
        member_address = '*****@*****.**'
        member = SpokeMailingListMember(self.org_name, self.list_address)
        member.create(member_address)
        result = member.get(member_address)['data']

        list_name, list_domain = self.list_address.split('@')
        rdn = '%s=%s' % (self.list_key, list_name)
        container = '%s=%s' % (self.container_attr, self.list_container)
        base_dn = '%s,%s=%s,%s' % (container, self.org_attr, self.org_name,
                                   self.base_dn)
        dn = '%s,%s' % (rdn, base_dn)
        dn_info = {
            self.list_destination_attr: [self.list_member, member_address]
        }
        expected_result = [(dn, dn_info)]
        self.assertEqual(result, expected_result)
Ejemplo n.º 5
0
 def test_get_missing_mailing_list_member(self):
     """Retrieve missing mailing list member; return empty list."""
     member_address = '*****@*****.**'
     member = SpokeMailingListMember(self.org_name, self.list_address)
     self.assertFalse(member.get(member_address)['data'])
Ejemplo n.º 6
0
 def test_get_missing_mailing_list_member(self):
     """Retrieve missing mailing list member; return empty list."""
     member_address = '*****@*****.**'
     member = SpokeMailingListMember(self.org_name, self.list_address)
     self.assertFalse(member.get(member_address)['data'])