Rahix / tbot

Automation/Testing tool for Embedded Linux Development
https://tbot.tools
GNU General Public License v3.0
91 stars 21 forks source link

linux.Path: implement mkdir method #52

Closed schlimmchen closed 3 years ago

schlimmchen commented 3 years ago

This is a proposal to implement mkdir() in tbot.machine.linux.path.Path to conveniently create a directory using the shell command mkdir.

Tests were added/extended to assert reasonable behavior of the new method. In the process of writing the tests, a TODO was cleaned up (reasoning see commit message), and a new test that checks the behavior of the Path methods against regular files was added.

The mkdir method was equipped with exist_ok and parents parameters for compatibility to Python's native pathlib.Path.mdkir() method.

schlimmchen commented 3 years ago

Updated branch after detecting that exists_ok (used in added method) is not the same as exist_ok (no second 's', as used in Python's native pathlib.mkdir()).