Tagged Questions
6
votes
3answers
386 views
Is having a switch to turn mocking on or off a code smell?
I have a method that looks like this:
def foobar(mock=False, **kwargs):
# ... snipped
foobar actually makes several calls to Amazon S3 and returns a composed result.
In order to make this ...
5
votes
2answers
240 views
Writing functional tests for a legacy project
I am trying to add a couple of tests to a legacy C project. The project basically consists of a command line tool that prints something to stdout every time an event happens. Now, since writing unit ...
4
votes
1answer
273 views
Behavior Driven Development and Unit Testing in Python
We might be interested in starting to incorporate a unit test suite to our project, which is coded in Python (and it uses Redis, PostgreSQL and some third-party libraries, if that bears into the ...
3
votes
1answer
139 views
How to keep unit tests independent?
I've read it at many places that unit tests should be independent. In my case I have a class that does data transformation. These steps must be done sequentially, otherwise they don't make sense. For ...
2
votes
2answers
297 views
How to populate a private container for unit test?
I have a class that defines a private (well, __container to be exact since it is python) container. I am using the information within said container as part of the logic of what the class does and ...
1
vote
2answers
601 views
Is there a good example of Python code for unit testing an api? [closed]
Do you know any good example of Python unit testing code for testing an API?
Thanks!
Update:
Found this very interesting question: ...
1
vote
3answers
141 views
Test case as a function or test case as a class
I am having a design problem in test automation:-
Requirements - Need to test different servers (using unix console and not GUI) through automation framework. Tests which I'm going to run - Unit, ...
1
vote
2answers
1k views
How can I do test automation using a python script to test a c program?
I was wondering if I can use a Python script to test a C program automatically.
Suppose I have a very simple C program which reads data (numbers as test cases) from the console, calculates them, then ...