[X] I've added tests applicable for this pull request
What does this Pull Request accomplish?
The code to load a DLL may change over time, leading to it returning different errors. This led to us returning a poor error when the driver runtime is not installed.
To improve our error behavior, raise a DriverNotInstalledError at the step where we look for the library, if it's not found. This happens before we attempt to load the library and since determining that the library wasn't found doesn't rely on getting a specific error, our behavior will be less likely to change.
Also add a test to cover this behavior.
List issues fixed by this Pull Request below, if any.
Fix #1970
What testing has been done?
Added a unit test.
Ran it without the fix: it failed
Ran it with the fix: it passed
There's nothing OS-specific about _get_library_name(), so it should be okay that the unit tests only run on Linux.
What does this Pull Request accomplish?
The code to load a DLL may change over time, leading to it returning different errors. This led to us returning a poor error when the driver runtime is not installed.
To improve our error behavior, raise a DriverNotInstalledError at the step where we look for the library, if it's not found. This happens before we attempt to load the library and since determining that the library wasn't found doesn't rely on getting a specific error, our behavior will be less likely to change.
Also add a test to cover this behavior.
List issues fixed by this Pull Request below, if any.
What testing has been done?
There's nothing OS-specific about
_get_library_name()
, so it should be okay that the unit tests only run on Linux.