def updateInfo(self, item, newlinks, oldlinks):
		'''爬虫爬完之后对数据库内容进行更新'''
		cur = self.conn.cursor()
		cur.execute("SELECT wid,did FROM Websites WHERE url=?", (item['url'],))
		wid, did = cur.fetchone()
		# website记录更新
		cur.execute("UPDATE Websites SET title=?,visited=1 WHERE wid=?", (item['title'], wid,))
		# 对应的domain记录中出度也需要更新
		cur.execute("UPDATE Domains SET outdegree=outdegree+? WHERE did=?", (len(item['links']), did,))

		# 对该网页中所有链接涉及的记录进行更新
		# 外部判断未出现过的链接
		for link,domain in newlinks:
			self.insertWebsite(link, domain)

		# 外部判断出现过的链接
		for link,domain in oldlinks:
			# 对对应的domain记录入度增加
			cur.execute("UPDATE Domains SET outdegree=outdegree+1 WHERE domain=?", (domain,))
		# 写入到文件
		self.conn.commit()
def test_volume_upload(self):
        """Test uploading volume to create an image"""
        # NOTE(gfidente): the volume uploaded in Glance comes from setUpClass,
        # it is shared with the other tests. After it is uploaded in Glance,
        # there is no way to delete it from Cinder, so we delete it from Glance
        # using the Glance images_client and from Cinder via tearDownClass.
        image_name = data_utils.rand_name(self.__class__.__name__ + '-Image')
        body = self.volumes_client.upload_volume(
            self.volume['id'], image_name=image_name,
            disk_format=CONF.volume.disk_format)['os-volume_upload_image']
        image_id = body["image_id"]
        self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                        self.images_client.delete_image,
                        image_id)
        waiters.wait_for_image_status(self.images_client, image_id, 'active')
        waiters.wait_for_volume_resource_status(self.volumes_client,
                                                self.volume['id'], 'available')

        image_info = self.images_client.show_image(image_id)
        self.assertEqual(image_name, image_info['name'])
        self.assertEqual(CONF.volume.disk_format, image_info['disk_format'])