Add some unit tests for sensor view
Fix method not catching a ValueError