l.s.m.t.helpers : module documentation

Part of lp.services.mailman.testing

Helper utilities.
Function get_size Return the size of a file, or -1 if it doesn't exist.
Function review_list Helper for approving a mailing list.
Function create_list Do everything you need to do to make the team's list live.
Function run_mailman Run a Mailman script.
Function subscribe Do everything you need to subscribe a person to a mailing list.
Function unsubscribe Unsubscribe the named person from the team's mailing list.
Function pending_hold_ids Return the set of pending held messages in Mailman for the list.
Function print_mailman_hold Print the held message as Mailman sees it.
Function collect_archive_message_ids Collect all the X-Message-Id values in the team's archived messages.
Function apply_for_list Like mailinglists_helper.apply_for_list() but with the right rooturl.
Function ensure_membership Ensure that all the addresses are members of the mailing list.
Function ensure_nonmembership Ensure that none of the addresses are members of the mailing list.
Function ensure_addresses_are_enabled Ensure that addresses are subscribed and enabled.
Function ensure_addresses_are_disabled Ensure that addresses are subscribed but disabled.
Function _membership_test Test membership via the predicate.
Function _ensure_addresses_are_in_state Ensure that addresses are in the specified state.
def get_size(path):
Return the size of a file, or -1 if it doesn't exist.
def review_list(list_name, status='approve'):
Helper for approving a mailing list.
def create_list(team_name):
Do everything you need to do to make the team's list live.
def run_mailman(*args):
Run a Mailman script.
def subscribe(first_name, team_name, use_alt_address=False):
Do everything you need to subscribe a person to a mailing list.
def unsubscribe(first_name, team_name):
Unsubscribe the named person from the team's mailing list.
def pending_hold_ids(list_name):
Return the set of pending held messages in Mailman for the list.

We do it this way in order to be totally safe, so that there's no possibility of leaving a locked list floating around. doctest doesn't always do the right thing.

def print_mailman_hold(list_name, hold_id):
Print the held message as Mailman sees it.
def collect_archive_message_ids(team_name):
Collect all the X-Message-Id values in the team's archived messages.
def apply_for_list(browser, team_name):
Like mailinglists_helper.apply_for_list() but with the right rooturl.
def _membership_test(team_name, people, predicate):
Test membership via the predicate.
Parametersteam_namethe name of the team/mailing list to test (type: string)
peoplethe sequence of IPersons to check. All validated emails from all persons are collected and checked for membership. (type: sequence of IPersons)
predicateA function taking two arguments. The first argument is the sent of member addresses found in the Mailman MailList data structure. The second argument is the set of validated email addresses for all the people. The function should return a boolean indicating whether the condition being tested is satisfied or not. (type: function)
Returnsthe string 'Timed out' if the predicate never succeeded, or None if it did. (type: string or None)
def ensure_membership(team_name, *people):
Ensure that all the addresses are members of the mailing list.
def ensure_nonmembership(team_name, *people):
Ensure that none of the addresses are members of the mailing list.
def _ensure_addresses_are_in_state(team_name, state, addresses):
Ensure that addresses are in the specified state.
def ensure_addresses_are_enabled(team_name, *addresses):
Ensure that addresses are subscribed and enabled.
def ensure_addresses_are_disabled(team_name, *addresses):
Ensure that addresses are subscribed but disabled.
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.