[Canonical Resistor Color Trio] Testing gap: values over 1000 which are not kiloohms

Python Resistor Color Trio currently doesn’t test for values over 1,000 which cannot be represented as kiloohms.

There is one test with zeros = red (2) … which is for value 2,000. This allows code the following to pass, which would generate incorrect values for zeros = red (2) and the second digit as anything other than 0. Note: this solution is akin to something that was used in a solution I was mentoring and not speculative.

    if value > 1000:
        return f"{num // 1000} kiloohms"
    return f"{number} ohms"

Upon looking at the canonical data for this exercise, I see the canonical data doesn’t address that case, so this is more of a question for the canonical data than Python.

Should I open an issue on that repo or keep discussions here?

The awk version of this test has much more comprehensive testing (and extends the units). Thoughts on syncing from awk test cases to the canonical data?

Hi Isaac!

We use the canonical data for the exercise.
If you are up for updating that canonical data you are free to do so(by me) and the python track will probably bring in those changes.

We don’t do that many costum cases and try to relay on canonical data to cover most cases. There are cases we make our own tests, like error hanedling and if there is a specific case we want to cover.

Although for this exercise we wont do an extra test to cover that case unless it comes directly from canonical data.

I guess I’ll just make a PR as a track maintainer :slight_smile:

Now I just need PR approval from two (three?) other track maintainers.