CA-142595: Unit tests

Add unit tests relating to the fix proposed by Wang Yanbin.

Signed-off-by: Flavien Quesnel <flavien.quesnel@citrix.com>
CA-142595: Refactor and additional unit tests

Refactor code from devscan.py and add the corresponding unit tests.

Signed-off-by: Flavien Quesnel <flavien.quesnel@citrix.com>