Tests should create virtual device instead of fail.

sane-test(5) provides a virtual device backend, designed for testing
software that interacts with SANE.  If PyInsane tests fail to find any
devices, we should create a test device instead.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
If a scanner can't perform a function, skip the test.

Some of the tests assume specific things about the capabilities of
the devices currently active.  Running tests against sane-test and an
fi-4120C2 revealed these don't always hold.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
Fix rawapi tests and enable them

The rawapi tests run into strange SANE behavior: some SANE options
cannot be read, set, or forced to auto.  For now, mark the test as
an expected failure.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
Revert "Fix rawapi tests and enable them"

This reverts commit 18863cab286ac159268d4292b5b7c3c82d6a4f26.
Fix rawapi tests and enable them

When testing option getting, we need to check the option capabilities
for their active status.  Inactive options cannot be read.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
Test behavior of getting/setting inactive options.

When testing option getting, get every option and ensure that any
inactive ones raise an exception.  Add a test for setting an inactive
option.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
Move sane_exit workaround to rawapi

Calling sane_exit is crashy - it often triggers segfaults on process
exit and prevents the rawapi tests from being run reliably.  This moves
the abstract workaround to the rawapi so we should never sane_exit.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
Merge pull request #14 from rvandegrift/master

Improve PyInsane tests, v3