Skip to content

Commit

Permalink
新版本发布
Browse files Browse the repository at this point in the history
  • Loading branch information
shengchenyang committed Jul 26, 2023
1 parent 0ae8830 commit c893f8e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
26 changes: 26 additions & 0 deletions docs/additional/news.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Release notes

## AyugeSpiderTools 3.3.2 (2023-07-26)

### Deprecation removals

- 无。

### Deprecations

- 无。

### New features

- 增加贝塞尔曲线生成轨迹的示例方法。

### Bug fixes

- 无。

### Code optimizations

- 将项目中有关文件的操作统一改为 `pathlib` 的方式。
- 根据 `consul` 获取配置的方式添加缓存处理,不用每次运行都多次调用同样参数来获取配置。减少请求次数,提高运行效率。
- 更新 `README.md` 内容,增加对应英文版本。

<hr/>

## AyugeSpiderTools 3.3.1 (2023-06-29)

### Deprecation removals
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "AyugeSpiderTools"
version = "3.3.1"
description = "scrapy 扩展库:用于扩展 Scrapy 功能来解放双手,还内置一些爬虫开发中的通用方法"
version = "3.3.2"
description = "scrapy 扩展库:用于扩展 Scrapy 功能来解放双手。"
authors = ["ayuge <[email protected]>"]
maintainers = ["ayuge <[email protected]>"]
readme = "README.md"
Expand Down
Binary file added tests/docs/image/mongo_upload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 4 additions & 7 deletions tests/test_mongoclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,15 @@ def test_find():

def test_upload():
"""测试 mongoDB 上传图片方法"""
import requests

mongodb = MongoDbBase(**mongodb_ori)
r = requests.get(url="https://static.jzmbti.com/ceshi/qn/1002.png")
content_type = dict(r.headers)["Content-Type"]
print("图片的类型 content_type 为:", content_type)
png_bytes = Path(tests_dir, "docs/image/mongo_upload.png").read_bytes()

# 返回上传后的 ID 及图片链接
mongo_upload_id, image_id = mongodb.upload(
file_name="test2.jpg",
_id="121212121213",
content_type=content_type,
content_type="image/png",
collection="fs",
file_data=r.content,
file_data=png_bytes,
)
assert mongo_upload_id is not None, image_id is not None

0 comments on commit c893f8e

Please sign in to comment.