def test_query_device_capacity_device_not_block(self):
        with nested(
            mock.patch('os.stat'),
            mock.patch('stat.S_ISBLK'),
            mock.patch('fcntl.ioctl'),
        ) as (os_stat, stat_is_block, ioctl):
            os_stat.return_value = mock.Mock(st_mode=33204)
            # Force ISBLK to reject the input 'device'
            stat_is_block.return_value = False

            with self.assertRaises(ValueError):
                bitmath.query_device_capacity(non_device_file)

            self.assertEqual(ioctl.call_count, 0)
Returns (session, responses, error, error_code)
dataset/ETHPy150Open tbielawa/bitmath/tests/test_query_device_capacity.py/TestQueryDeviceCapacity.test_query_device_capacity_device_not_block--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/sms/handlers/keyword.py/start_session_with_error_handling