def test_isfile():
    'Validate that the value is an existing file.'
    schema = vol.Schema(cv.isfile)
    fake_file = 'this-file-does-not.exist'
    assert (not os.path.isfile(fake_file))
    for value in ('invalid', None, (- 1), 0, 80000, fake_file):
        with pytest.raises(vol.Invalid):
            schema(value)
    with patch('os.path.isfile', Mock(return_value=True)), patch('os.access', Mock(return_value=True)):
        schema('test.txt')
Validate that the value is an existing file.
def test_isfile():
    
    schema = vol.Schema(cv.isfile)
    fake_file = 'this-file-does-not.exist'
    assert (not os.path.isfile(fake_file))
    for value in ('invalid', None, (- 1), 0, 80000, fake_file):
        with pytest.raises(vol.Invalid):
            schema(value)
    with patch('os.path.isfile', Mock(return_value=True)), patch('os.access', Mock(return_value=True)):
        schema('test.txt')