Files
my-vault/03_Resources/Development/Languages/Python/Mock Patching.md
T
windyboy b182762e14 refactor(vault): Phase 3 — metadata convergence
- Backfill `created` frontmatter on 266 active notes (git date or mtime)
- Normalize `status` to 4 values: draft/active/done/archived (11 notes)
  - Active/进行中/needs-review → active
  - archive → archived
  - 待执行/conditional → draft
  - 完成/accepted → done
- Declare clipper boundary: 04_Archive/Inbox-Clippings/** exempt from migration
- Update depth rule: max 3 → max 4 levels (new notes only)
- Add metadata-converge.mjs script for reproducibility
2026-09-26 11:37:19 +08:00

8 lines
540 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
created: 2026-01-05
---
## Highlights:
`Mock.patch ` will intercept import statements identified by a string, and return a Mock instance you can preconfigure using the techniques we discussed above.
we need to supply `Mock.patch ` with a string representing our specific import. We do not want to supply simply `os.getcwd ` since that would patch it for all modules, instead we want to supply the module under test’s import of os , i.e. work.os . When the module is imported patch will work its magic and return a Mock instead.