def testBadPort(self, default_user, port): out_server, out_name, out_port = SessionsControl._parse_conn( 'localhost:%s' % port, default_user) assert out_server == 'localhost:%s' % port assert out_name == default_user assert not out_port
def testEmptyString(self, default_user): out_server, out_name, out_port = SessionsControl._parse_conn( '', default_user) assert not out_server assert out_name == default_user assert not out_port
def testConnectionString(self, default_user, user_prefix, server, port_suffix): in_server = '%s%s%s' % (user_prefix, server, port_suffix) out_server, out_name, out_port = SessionsControl._parse_conn( in_server, default_user) assert out_server == server if user_prefix: assert out_name == user_prefix[:-1] else: assert out_name == default_user if port_suffix: assert out_port == port_suffix[1:] else: assert not out_port