<s> import unittest2 as unittest <EOL> from mox3 . mox import MoxTestBase , IsA <EOL> from slimta . relay . smtp . static import StaticSmtpRelay <EOL> from slimta . relay . smtp . client import SmtpRelayClient <EOL> class TestStaticSmtpRelay ( unittest . TestCase , MoxTestBase ) : <EOL> def test_add_client ( self ) : <EOL> static = StaticSmtpRelay ( '<STR_LIT>' ) <EOL> ret = static . add_client ( ) <EOL> self . assertIsInstance ( ret , SmtpRelayClient ) <EOL> def test_add_client_custom ( self ) : <EOL> def fake_class ( addr , queue , ** kwargs ) : <EOL> self . assertEqual ( ( '<STR_LIT>' , <NUM_LIT> ) , addr ) <EOL> return '<STR_LIT:success>' <EOL> static = StaticSmtpRelay ( '<STR_LIT>' , client_class = fake_class ) <EOL> self . assertEqual ( '<STR_LIT:success>' , static . add_client ( ) ) </s>
