Generates correct "make flash" command even when partition table has no factory partition. Also adds unit tests for parttool.py Closes https://github.com/espressif/esp-idf/issues/2086