'Test if validate expands the user correctly.'

def test_validate_expandvars(self, klass, os_mock, monkeypatch):

    os_mock.path.isdir.side_effect = (lambda path: (path == '/home/foo/foobar'))
    os_mock.path.isabs.return_value = True
    klass().validate('$HOME/foobar')
    os_mock.path.expandvars.assert_called_once_with('$HOME/foobar')
