'Test if validate expands the user correctly.'

def test_validate_expanduser(self, klass, os_mock):

    os_mock.path.isfile.side_effect = (lambda path: (path == '/home/foo/foobar'))
    os_mock.path.isabs.return_value = True
    klass().validate('~/foobar')
