mock共14篇
How to debug your Python mocks or imports-拾光赋

How to debug your Python mocks or imports

How to debug your Python mocks or imports,Hands up if you've spent 20 minutes making a feature then 2 hours testing it . I recently struggled with mocking an object declared global...
kity的头像-拾光赋kity6个月前
02712
Datafaker: Simplifying Test Data Generation for Java and Kotlin-拾光赋

Datafaker: Simplifying Test Data Generation for Java and Kotlin

Datafaker: Simplifying Test Data Generation for Java and Kotlin,In the world of software development, effective testing is crucial to ensure the reliability and functionality of ap...
kity的头像-拾光赋kity2年前
0257
Building a Basic HTTP Server with Python: A Guide for Automation and Prototyping-拾光赋

Building a Basic HTTP Server with Python: A Guide for Automation and Prototyping

Building a Basic HTTP Server with Python: A Guide for Automation and Prototyping, What is this article about This article presents a basic example of a Python-based HTTP server. It...
kity的头像-拾光赋kity2年前
04610
python: unit test with fixture and patch decorators-拾光赋

python: unit test with fixture and patch decorators

python: unit test with fixture and patch decorators,In the [pervious article], I used multiple patch decorators to mock several functions. This time, I use Fixture with the decorat...
kity的头像-拾光赋kity2年前
02314
python: Mock variations-拾光赋

python: Mock variations

python: Mock variations,This is my note on how to create various mocks. Please let me know if you have trouble creating a mock in your test. import pytest from unittest.mock import...
kity的头像-拾光赋kity2年前
02410
python: use multiple patch decorators to mock functions-拾光赋

python: use multiple patch decorators to mock functions

python: use multiple patch decorators to mock functions,I wrote how to mock in the previous article. This time, I mock multiple functions in the test to see how I can handle them. ...
kity的头像-拾光赋kity2年前
03814
python: unit test with mock functions from different modules-拾光赋

python: unit test with mock functions from different modules

python: unit test with mock functions from different modules,I recently started learning python 3 and unit test with pytest and unittest. As I struggle to figure out how to mock in...
kity的头像-拾光赋kity2年前
0259
Testing created/updated/auto_now fields in Django-拾光赋

Testing created/updated/auto_now fields in Django

Testing created/updated/auto_now fields in Django, Intro Django's auto_now_add and auto_now model field arguments provide an easy way to create dates when an entity is created and/...
kity的头像-拾光赋kity3年前
0236
Mocking Redis in Python's unittest-拾光赋

Mocking Redis in Python’s unittest

Mocking Redis in Python's unittest,Hello folks, This blog will guide you to mock redis without using any new library. Redis is used as cache in almost every application. It's very ...
kity的头像-拾光赋kity3年前
02410
Unit testing with assertive mocks vs not testing implementation: Why not both?-拾光赋

Unit testing with assertive mocks vs not testing implementation: Why not both?

Unit testing with assertive mocks vs not testing implementation: Why not both?,Often I will have a function that contains another function call, and want to write a unit test for i...
kity的头像-拾光赋kity4年前
03714
Mock external dependencies in Python-拾光赋

Mock external dependencies in Python

Mock external dependencies in Python,Testing python modules or code that have any external calls such as third-party API calls or database calls, can get difficult. This is where m...
kity的头像-拾光赋kity5年前
05011
Python unit testing with Mock - Part Two-拾光赋

Python unit testing with Mock – Part Two

Python unit testing with Mock - Part Two, How do you write tests? Python has many frameworks for writing tests, but ultimately they come down to collecting functions whose names be...
kity的头像-拾光赋kity8年前
05014