473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How to create mock objects for logger module to write unit tests

Need to write unit tests for the attached python module.

Wanted to create mock objects for logger concept.

need help in creating and using logger mock objects for writing unit tests for display function

logger has 2 functions: log and info
Attached Files
File Type: txt Code to unit test.txt (1.5 KB, 280 views)
Jul 19 '16 #1
0 933

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Edvard Majakari | last post by:
Greetings, fellow Pythonistas! I'm about to create three modules. As an avid TDD fan I'd like to create typical 'use-cases' for each of these modules. One of them is rather large, and I wondered...
1
by: ischenko | last post by:
There is a (relatively) widely used technique in unit testing, called mock objects. There is even a pMock library which provides a Mock class for a Python environment. Given the "duck typing"...
5
by: Jacob Page | last post by:
I have released interval-0.2.1 at http://members.cox.net/apoco/interval/. IntervalSet and FrozenIntervalSet objects are now (as far as I can tell) functionality equivalent to set and frozenset...
3
by: | last post by:
I am working on a web/webservice application that has a service layer. Most service methods will perform an access-check before executing. This check uses the IPrincipal credentials available in...
2
by: Ben Finney | last post by:
Howdy all, My practice when writing unit tests for a project is to make 'test/' subdirectories for each directory containing modules I want to test. project-foo/ +-- lib/ | +-- test/ +--...
4
by: David Thielen | last post by:
Hi; Are there mock objects anywhere that I can use to write nunit tests for my code behind methods? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
3
by: Joe Van Dyk | last post by:
Say I've written a class that wraps around a particular (complex) communication service library. I want to unit test objects that use that communication service. Is the "best practice" to...
2
by: Terry | last post by:
I'm looking at NMock2 as a framework to create mock objects during my unit testing. One part that I'm trying to understand is that it will mock interfaces, not concrete classes. I normally don't...
5
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 Team Edition for Software Developers I've used the wizard under the Test menu to create a bunch of unit tests. When I click "Test -Start Selected Test Project...
0
by: macap | last post by:
Hello, I am figuring out the possibilities to write Unit-Tests for Webforms written in C#/ASP.NET/AJAX. In my research I found a tool, Selenium, which looks very nice: ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.