Пример #1
0
    def test_delivered(self):
        clear_queue()
        queue().push("To: gooduser@localhost\nFrom: tester@localhost\n\nHi\n")

        assert delivered("gooduser@localhost"), "Test message not delivered."
        assert not delivered("baduser@localhost")
        assert_in_state('tests.handlers.simple_fsm_mod', 'gooduser@localhost', 'tester@localhost', 'START')
Пример #2
0
def test_delivered():
    clear_queue()
    queue().push("To: gooduser@localhost\nFrom: tester@localhost\n\nHi\n")

    assert delivered("gooduser@localhost"), "Test message not delivered."
    assert not delivered("baduser@localhost")
    assert_in_state('salmon_tests.handlers.simple_fsm_mod', 'gooduser@localhost', 'tester@localhost', 'START')
Пример #3
0
def test_drops_open_relay_messages():
    """
    But, make sure that mail NOT for test.com gets dropped silently.
    """
    client.begin()
    client.say("*****@*****.**", "Relay should not happen")
    assert len(queue()) == 0, "You are configured currently to accept everything. " \
                              "You should change config/settings.py router_defaults " \
                              "so host is your actual host name that will receive mail."
Пример #4
0
def test_drops_open_relay_messages():
    """
    But, make sure that mail NOT for test.com gets dropped silently.
    """
    client.begin()
    client.say("*****@*****.**", "Relay should not happen")
    assert queue().count() == 0, "You are configured currently to accept everything. " \
                                 "You should change config/settings.py router_defaults " \
                                 "so host is your actual host name that will receive mail."
Пример #5
0
def test_clear_queue():
    queue().push("Test")
    assert_equal(queue().count(), 1)

    clear_queue()
    assert_equal(queue().count(), 0)
Пример #6
0
    def test_clear_queue(self):
        queue().push("Test")
        self.assertEqual(queue().count(), 1)

        clear_queue()
        self.assertEqual(queue().count(), 0)
Пример #7
0
def test_clear_queue():
    queue().push("Test")
    assert queue().count() > 0

    clear_queue()
    assert queue().count() == 0
Пример #8
0
def test_clear_queue():
    queue().push("Test")
    assert_equal(queue().count(), 1)

    clear_queue()
    assert_equal(queue().count(), 0)
Пример #9
0
def test_clear_queue():
    queue().push("Test")
    assert queue().count() > 0

    clear_queue()
    assert queue().count() == 0