olofk / ipyxact

Python-based IP-XACT parser
MIT License
121 stars 47 forks source link

Improve IpxactInt handling of input strings #9

Closed csquaredphd closed 7 years ago

csquaredphd commented 7 years ago

On my first usage of ipyxact, parsing failed because my input file used 'b0 for register reset values. I tracked down the problem, fixed it, and added unit tests to cover this and many other valid input formats.

Thanks, Chris

olofk commented 7 years ago

Hi Chris,

Many thanks for the patches. Especially starting on unit tests is highly appreciated. Could you just give me some hint how to run the tests. Have only used pytest before, never unittest, so I feel a bit lost even after reading https://docs.python.org/3/library/unittest.html python -m unittest tells me that it has found 0 tests. Tried running it from the project root as well as the tests/unit directory

olofk commented 7 years ago

oh, figured out that python -m unittest tests/unit/IpxactInt.py works. Will review tomorrow

olofk commented 7 years ago

All good. Picked and pushed. Thanks

I noticed however that 7 tests are failing for me. Seems to be all the tests with underscore. One of us will need to do a follow-up patch for that

olofk commented 7 years ago

Fixed with 2c398d01bd2037a46c10c482bc08f67d4bdc7a4a

csquaredphd commented 7 years ago

It looks like only Python 3.5+ ignores underscores in string-to-integer conversions... I was using 3.6.2.

olofk commented 7 years ago

I've set up CI testing with Travis now for Python 2.7, 3.4, 3.5 and 3.6. Hopefully this will catch similar issues in the future