Skip to content Skip to sidebar Skip to footer
Showing posts with the label Mocking

Mocking Python Class In Unit Test And Verifying An Instance

I'm trying to unit test an SFTP helper class that makes some calls to the pysftp module. I want… Read more Mocking Python Class In Unit Test And Verifying An Instance

How Do You Pass Exception Arguments To Python Unittest Mock Side Effect?

How do you pass exceptions that require arguments as mock side_effects? I'm trying to test fo… Read more How Do You Pass Exception Arguments To Python Unittest Mock Side Effect?

Making A Wrapper For `mock.patch`

Some customized patches from mock.patch I want to use over and over without littering my test code … Read more Making A Wrapper For `mock.patch`

How Should I Verify A Log Message When Testing Python Code Under Nose?

I'm trying to write a simple unit test that will verify that, under a certain condition, a clas… Read more How Should I Verify A Log Message When Testing Python Code Under Nose?

Mock Builtin 'open" Function When Used In Contextlib

I know this question has been asked before, but I have a particular problem, meaning I want the moc… Read more Mock Builtin 'open" Function When Used In Contextlib

Does Someone Have An Example Of Unit-testing A Soap Api With Python Zeep And Mock?

I'm building a Python app that accesses a 3rd party SOAP API with Python-zeep. I want to implem… Read more Does Someone Have An Example Of Unit-testing A Soap Api With Python Zeep And Mock?