All Questions
11 questions
4
votes
3
answers
376
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 ...
4
votes
1
answer
172
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 ...
6
votes
1
answer
3k
views
Multiplayer card game "Hearts" with OOP in Python
To practice Object-Oriented Python and learning how to write tests, I found an exercise and solved it as below(all classes are put in one block of code to make the question a little bit more readable):...
3
votes
1
answer
170
views
Testing Terminal Text Game with Classes and Game Loop
I am making a super simple and dumb terminal text game to try out unittest in python. I have ran into a problem. When I run the test, the game loop is ran, and I have to manually insert input to ...
10
votes
3
answers
2k
views
Secrets management, operational security, keeping API tokens hidden while streaming
I've taken up code streaming and I'm concerned that as I do so, I'll leak an API token somewhere.
It was suggested that I use something like "a secrets.toml or secrets.yaml or secrets.json file." But ...
3
votes
2
answers
298
views
Simple OOP currency converter - follow-up
This is a follow up question on this post
This is what I changed on my previous code:
I use Exchanger and PairCurrency class ...
5
votes
1
answer
88
views
Class to parse a file sanitizing each line with a set of methods
I am parsing a set of lines from a file, after reading the file content with Parser.read_file() I apply a set of methods to solve different issues each line may ...
2
votes
1
answer
3k
views
Computing the profit or loss from a list of trades
I am coming from C# and I am learning how to use Python more seriously.
So I decided to try a little side project to help me see how much I earn (or lose) from my trades on the stock market.
I would ...
3
votes
1
answer
1k
views
Simple geometry problems involving rectangles and circles in Python 3
I'm working with some simple geometry problems featuring rectangles and circles. My code is as follows:
...
3
votes
3
answers
5k
views
Bowling scoring kata
I've been writing basic Python scripts for a while now to help process data or automate some task but I've decided I should start picking up unit testing and objective orientated programming (the vast ...
1
vote
0
answers
2k
views
Unit tests for a Redshift wrapper class
I'm somewhat new to TDD and unit testing, but I've written a suite of unit tests to check my functionality. The basic classes automate simple load and unload operations from s3 and redshift, and ...