mpdt 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mpdt-0.2.2 → mpdt-0.2.3}/PKG-INFO +1 -1
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/__init__.py +1 -1
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/publish_list.py +5 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/PKG-INFO +1 -1
- {mpdt-0.2.2 → mpdt-0.2.3}/pyproject.toml +1 -1
- {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_fetchers.py +14 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/LICENSE +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/README.md +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/__main__.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/cli.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/config.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/errors.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/__init__.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/article_detail.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/datacube.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/metrics.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/report.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/session.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/store.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/SOURCES.txt +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/dependency_links.txt +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/entry_points.txt +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/requires.txt +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/top_level.txt +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/setup.cfg +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_cli.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_config.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_metrics.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_report.py +0 -0
- {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_store.py +0 -0
|
@@ -53,6 +53,11 @@ def parse_publish_list(raw: str) -> dict:
|
|
|
53
53
|
if not isinstance(info, dict):
|
|
54
54
|
continue
|
|
55
55
|
ct = (info.get('publish_info') or {}).get('create_time')
|
|
56
|
+
if not (isinstance(ct, int) and ct > 0):
|
|
57
|
+
# 贴图类(type=9 群发图)publish_info 为空对象,群发时间在 sent_info.time
|
|
58
|
+
# (R70 实证:2247485215 sent_info.time=1792145145 = 2026-10-16 18:05:45+08,
|
|
59
|
+
# 与 publish-read.py 实查 create_time 一致;保持 article 侧口径=群发时刻)
|
|
60
|
+
ct = (info.get('sent_info') or {}).get('time')
|
|
56
61
|
pub_date = ''
|
|
57
62
|
if isinstance(ct, int) and ct > 0:
|
|
58
63
|
pub_date = _dt.datetime.fromtimestamp(
|
|
@@ -28,6 +28,20 @@ class TestPublishList(unittest.TestCase):
|
|
|
28
28
|
for k in ('appmsgid', 'itemidx', 'title', 'read_num', 'share_num', 'like_num'):
|
|
29
29
|
self.assertIn(k, a)
|
|
30
30
|
|
|
31
|
+
def test_pic_type_gets_publish_date_from_sent_info(self):
|
|
32
|
+
# R70:贴图类 publish_info 为空对象,时间戳在 sent_info.time(群发时间)。
|
|
33
|
+
# 实证:2247485215 sent_info.time=1792145145 → 2026-10-16 18:05:45+08,
|
|
34
|
+
# 与 PIC-rea 实查 t0(publish-read.py create_time)完全一致。
|
|
35
|
+
out = parse_publish_list(self.raw)
|
|
36
|
+
by_id = {a['appmsgid']: a for a in out['articles']}
|
|
37
|
+
a = by_id.get(2247485215)
|
|
38
|
+
self.assertIsNotNone(a, 'fixture 应含贴图样本 2247485215')
|
|
39
|
+
self.assertEqual(a['publish_date'], '2026-10-16')
|
|
40
|
+
self.assertEqual(a['create_time'], 1792145145)
|
|
41
|
+
b = by_id.get(2247485156)
|
|
42
|
+
self.assertIsNotNone(b, 'fixture 应含贴图样本 2247485156')
|
|
43
|
+
self.assertEqual(b['publish_date'], '2026-10-16')
|
|
44
|
+
|
|
31
45
|
def test_structure_change_raises_upstream_4(self):
|
|
32
46
|
with self.assertRaises(UpstreamError):
|
|
33
47
|
parse_publish_list('{"base_resp":{"ret":0},"publish_page":"not json"}')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|