Skip to content

Commit

Permalink
Update resistor_color_expert_test.py (#3797)
Browse files Browse the repository at this point in the history
Add additional tests for some edge cases.  Note that "1 ohms", "1 kiloohms" and "1 megaohms" should really be "ohm" singular but that's out of scope of the requirements for this exercise.
  • Loading branch information
xanni authored Oct 23, 2024
1 parent 1d2c981 commit 83e71ed
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ def test_brown_red_orange_green_and_blue(self):
self.assertEqual(
resistor_label(["brown", "red", "orange", "green", "blue"]), "12.3 megaohms ±0.25%"
)

def test_brown_black_brown_yellow_and_violet(self):
self.assertEqual(
resistor_label(["brown", "black", "brown", "yellow", "violet"]), "1.01 megaohms ±0.1%"
)

def test_brown_black_red_and_red(self):
self.assertEqual(
resistor_label(["brown", "black", "red", "red"]), "1 kiloohms ±2%"
)

0 comments on commit 83e71ed

Please sign in to comment.