twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

Update to truncate_path to fix bug #139

Closed twVolc closed 1 month ago

twVolc commented 1 month ago

Fixes #138

@ubdbra001 could you please check this fix, since you wrote truncate_path() I want to make sure it still acts how you want it to. But with the previous version it was causing an error with the settings frame (and possibly others) so I've made these edits to make the function a little more forgiving with compatible paths.

twVolc commented 1 month ago

I've made these updates. But not certain how to actually run the tests, so would you be able to run these to check it works as expected please?

twVolc commented 1 month ago

Ah yes, god catch! I guess that's why tests are so useful! Are you happy for me to merge now?

ubdbra001 commented 1 month ago

Had to make a small change to fix an error, but otherwise ready to merge I think.

Just FYI regarding tests: You need to have pytest installed and then you can run the command pytest ./tests/test_utils.py in the terminal to run them. There is also integration in most IDEs (Docs for VsCode, Docs for PyCharm).

In the future we can setup a test runner on Github so that they will be run when you (e.g.) make a pull request, and merging will be partly contingent on the tests passing. But we're not really there yet with the test suite.