'Ensure user dot files check detects files that are world writable.'

def testUserDotFilesCheck(self):

    data = [self.CreateStat('/root/.bash_history', 0, 0, 33261), self.CreateStat('/root/.bash_logout', 0, 0, 33277), self.CreateStat('/root/.bashrc', 0, 0, 33274), self.CreateStat('/root/.gitconfig', 0, 0, 33275), self.CreateStat('/home/user/.mozilla', 100, 70, 33261), self.CreateStat('/home/user/.vim', 100, 70, 16895), self.CreateStat('/home/user/.netrc', 100, 70, 33204)]
    results = self.GenResults(['UserDotFiles'], [data])
    check_id = 'CIS-USER-DOT-FILES-DIRS-WORLD-WRITABLE'
    sym = 'Found:    Dot    files    or    folders    in    user    home    directory    are    world    writable.'
    found = ['/root/.bashrc    user:    0,    group:    0,    mode:    -rwxrwx-w-', '/root/.gitconfig    user:    0,    group:    0,    mode:    -rwxrwx-wx', '/home/user/.vim    user:    100,    group:    70,    mode:    drwxrwxrwx']
    self.assertCheckDetectedAnom(check_id, results, sym, found)
    check_id = 'CIS-DOT-NETRC-FILE-EXISTS'
    sym = "Found:    The    .netrc    file    exists    in    a    user's    home    directory."
    found = ['/home/user/.netrc    user:    100,    group:    70,    mode:    -rw-rw-r--']
    self.assertCheckDetectedAnom(check_id, results, sym, found)
