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')
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')
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."
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."
def test_clear_queue(): queue().push("Test") assert_equal(queue().count(), 1) clear_queue() assert_equal(queue().count(), 0)
def test_clear_queue(self): queue().push("Test") self.assertEqual(queue().count(), 1) clear_queue() self.assertEqual(queue().count(), 0)
def test_clear_queue(): queue().push("Test") assert queue().count() > 0 clear_queue() assert queue().count() == 0