Repository navigation
add: constructor injection - #186
Conversation
tested as single file testrun with Python 2.7 only
Codecov Report
@@ Coverage Diff @@
## master #186 +/- ##
==========================================
+ Coverage 94.51% 94.59% +0.07%
==========================================
Files 55 57 +2
Lines 2333 2366 +33
==========================================
+ Hits 2205 2238 +33
Misses 128 128
Continue to review full report at Codecov.
|
|
ready for review |
|
|
||
| def get_current_time_as_html_fragment(self): | ||
| current_time = self.time_provider.now() | ||
| current_time_as_html_fragment = "<span class=\"tinyBoldText\">" + current_time + "</span>" |
There was a problem hiding this comment.
It's better to use .format here instead of + (true for all string concatenations that you do)
There was a problem hiding this comment.
Thanks but that's not what I meant. The idea is to avoid string concatenations completely since a) strings are immutable and there is some overhead included, b) it is more idiomatic in Python to use .format. The idea looks like that: "<span class=\"tinyBoldText\">{}{}</span>".format(current_time.hour, current_time.minute)
There was a problem hiding this comment.
Isn't that exactly what I changed in commit 4cca032?
quick and dirty implementation (needs some cleanup) in a new subdirectory for "design for testability" patterns. tested as single file testrun with Python 2.7 only (just let travis do the job...)