def get_w3af_version(): ''' :return: A string with the w3af version. ''' commit = to_short_id(get_latest_commit()) if is_git_repo() else 'unknown' cdate = ' - %s' % get_latest_commit_date() if is_git_repo() else '' vnumber = file(VERSION_FILE).read().strip() return ('w3af - Web Application Attack and Audit Framework\n' 'Version: %s\n' 'Revision: %s%s\n' 'Author: Andres Riancho and the w3af team.') % (vnumber, commit, cdate)
def update(self): if self._force_upd in (None, True) and is_git_repo() and \ verify_dir_has_perm(W3AF_LOCAL_PATH, os.W_OK, levels=1): try: resp = self._call_update() self._handle_update_output(resp) except KeyboardInterrupt: pass except Exception, ex: self._logger('An error occurred while updating: "%s"' % ex) # TODO: Please read https://github.com/andresriancho/w3af/issues/6 # for more information on what's missing here '''
def test_is_git_repo_negative(self): self.assertFalse(is_git_repo('/etc/'))
def test_is_git_repo(self): self.assertTrue(is_git_repo('.'))