def robotsrulesetOfDomain(self, domain):
		'''检查domain是否在数据库中,
			否 --> (False, None)
			是 --> (True, 数据库中存储的robots.txt内容)
		'''
		exist = False
		cur = self.conn.cursor()
		# 是否存在
		cur.execute("SELECT 1 FROM Domains WHERE domain=?", (domain,))
		if cur.fetchone() :
			exist = True
		# 存在的话,结果是什么
		cur.execute("SELECT rules FROM Domains,Rulesets "
			"WHERE domain=? AND Domains.did=Rulesets.did"
			,(domain,) )
		ruleset = cur.fetchone()
		return (exist, ruleset)
def test_conf_inline_tls(self):
        fake_context = mock.Mock()
        with mock.patch.object(ssl, 'create_default_context',
                               return_value=fake_context):
            with mock.patch.object(memcache, 'ConfigParser',
                                   get_config_parser()):
                memcache.MemcacheMiddleware(
                    FakeApp(),
                    {'tls_enabled': 'true',
                     'tls_cafile': 'cafile',
                     'tls_certfile': 'certfile',
                     'tls_keyfile': 'keyfile'})
            ssl.create_default_context.assert_called_with(cafile='cafile')
            fake_context.load_cert_chain.assert_called_with('certfile',
                                                            'keyfile')