How to use the mailmerge.__main__.enumerate_limit function in mailmerge

To help you get started, we’ve selected a few mailmerge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awdeorio / mailmerge / tests / test_helpers.py View on Github external
def test_enumerate_limit_values():
    """Verify limit=-1 results in no early termination."""
    values = ["a", "b", "c"]
    for i, value in mailmerge.__main__.enumerate_limit(values, -1):
        assert value == values[i]
github awdeorio / mailmerge / tests / test_helpers.py View on Github external
def test_enumerate_limit_zero():
    """Verify limit results in early termination."""
    iterations = 0
    for _, _ in mailmerge.__main__.enumerate_limit(["a", "b", "c"], 0):
        iterations += 1
    assert iterations == 0
github awdeorio / mailmerge / tests / test_helpers.py View on Github external
def test_enumerate_limit_stop_early():
    """Verify limit results in early termination."""
    iterations = 0
    for _, _ in mailmerge.__main__.enumerate_limit(["a", "b", "c"], 2):
        iterations += 1
    assert iterations == 2