Exemple #1
0
 def test_from_sys_path_device_not_found(self, context):
     sys_path = "there_will_not_be_such_a_device"
     with pytest.raises(DeviceNotFoundAtPathError) as exc_info:
         Device.from_sys_path(context, sys_path)
     error = exc_info.value
     assert error.sys_path == sys_path
     assert str(error) == "No device at {0!r}".format(sys_path)
Exemple #2
0
 def test_from_sys_path_device_not_found(self, context):
     sys_path = 'there_will_not_be_such_a_device'
     with pytest.raises(DeviceNotFoundAtPathError) as exc_info:
         Device.from_sys_path(context, sys_path)
     error = exc_info.value
     assert error.sys_path == sys_path
     assert str(error) == 'No device at {0!r}'.format(sys_path)
Exemple #3
0
 def test_from_sys_path(self, context, device_data):
     device = Device.from_sys_path(context, device_data.sys_path)
     assert device is not None
     assert device.sys_path == device_data.sys_path
Exemple #4
0
 def test_from_sys_path(self, context, device_data):
     device = Device.from_sys_path(context, device_data.sys_path)
     assert device is not None
     assert device.sys_path == device_data.sys_path
Exemple #5
0
 def test_from_path(self, context, device_path, sys_path):
     device = Device.from_path(context, device_path)
     assert device is not None
     assert device == Device.from_sys_path(context, sys_path)
     assert device == Device.from_path(context, sys_path)