Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
3 answers
177 views

Function to calculate energy where all parameters must be positive

I have a function which requires all parameters to be positive: ...
Idieh's user avatar
  • 73
1 vote
1 answer
83 views

Event manager based on decorators

This module is a simple event manager that works with decorators. I would like feedback on: Bugs Any ideas to get rid of the classevent decorator, which ...
rdesparbes's user avatar
6 votes
3 answers
2k views

Python strong password validator ( with unit test )

Lately, I was studying the concept of unit testing in python, so I have decided to write a imperative strong password validator ( checker ) and also attach a unit test to it. I would like to know if ...
KhodeNima's user avatar
  • 419
1 vote
1 answer
158 views

Change unit-test structure to avoid try/except/finally clause

I have 10 or 20 tests with the same structure which I would like to improve. The test itself is nested within a try/except/finally clause to make sure that some of ...
Mathieu's user avatar
  • 251
4 votes
3 answers
384 views

Money class in python

I have recently created the Money class with a helper class Currency. What do you think about the following code? I created unit ...
whiteman808's user avatar
4 votes
1 answer
202 views

Python unit tests for storing and loading objects

I wrote some code and thought I may get better with some feedback. I program for almost 5 years, mainly in python. I care most about the unit testing. I am not really sure, how industry standard unit ...
Cjw9000's user avatar
  • 41
1 vote
0 answers
77 views

Unit tests coverage of functools extension library

A few days ago I requested a review of my functools extension library. Since I did not have any unit tests for it, I started writing some for the revised version of this library. I'd like some ...
Richard Neumann's user avatar
3 votes
1 answer
70 views

Functional tests of downloadpdf, a python CLI app

Shared below is a functionality test. I would love to get some review from the community. Thank you. The idea of the system is a simple CLI application which can be used to download PDF from a given ...
Anit Shrestha's user avatar
5 votes
1 answer
84 views

Writing unit testing for conference management class

I try to use unittest for conference class, but I am not sure that I have considered all condition or more complex tests should be added? conference.py ...
user1568064's user avatar
5 votes
2 answers
584 views

Complex Numbers & Unit Tests in Python

I've just started a course that will require knowledge and experience with Python for future projects, which I don't have, so I thought I'd give it a go to familiarize myself with it and get some ...
cliesens's user avatar
  • 558
5 votes
3 answers
2k views

CAN Bus testing

I am creating a Python 3.8 script that executes a series of tests that reads and writes information to and from a CAN bus network. I'm using the python-can and the cantools packages. I've managed to ...
Tim51's user avatar
  • 53
1 vote
1 answer
182 views

Testing Depth First Search Using Pytest

I have an implementation of depth first search, which I want to test using the pytest framework. I would be making test cases for other graph algorithms, and would ...
Saurabh's user avatar
  • 445
2 votes
0 answers
48 views

Finding, substituting and executing values in dictionaries

I wrote this code for finding, substituting and executing values in dictionary, much like $() bash operator works. I used nested functions for this, forming ...
nonForgivingJesus's user avatar
4 votes
1 answer
174 views

Is this a good unit test for testing three types of mappings all at once?

This question is related to my previous two questions, in which I have implemented HashTable, and also SortedListMap and ...
user141240's user avatar
1 vote
2 answers
818 views

Unit tests for anagram finder

I did this test for a job and the feedback was: "while many were added to test private methods, they did not do anything to ensure the public interface worked correctly, edge cases were missed" But ...
Jonny Shanahan's user avatar

15 30 50 per page