def _not_gid_owns_checks(): print () print (" --- object gid not owns checks --- ") print () _objadj = 'object is ' _objvrb = 'owned by gid ' _objsep = ': ' print (" positive check ") print () obj = test_objects + '_gid_owns_not' # existence check is just for us if dom._exists(obj): if dom._not_gid_owns(obj): _bool = 'not ' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._pass(msg) else: _bool = '' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit print () print (" negative check ") print () obj = test_objects + '_gid_owns' # existence check is just for us if dom._exists(obj): if not dom._not_gid_owns(obj): _bool = '' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._pass(msg) else: _bool = 'not ' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit
def _not_isfile_checks(): print () print (" --- not file type checks --- ") print () _objadj = 'object is ' _objvrb = 'a file ' _objsep = ': ' print (" positive check ") print () obj = test_objects + '_isfile_not' # existence check is just for us if dom._exists(obj): if dom._not_isfile(obj): _bool = 'not ' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._pass(msg) else: _bool = '' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit print () print (" negative check ") print () obj = test_objects + '_isfile' # existence check is just for us if dom._exists(obj): if not dom._not_isfile(obj): _bool = '' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._pass(msg) else: _bool = 'not ' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit
def _file_does_exist(pathobj): if dom._exists(pathobj): dcm._fail("file does exist: " + pathobj) return True else: dcm._fail("file does not exist: " + pathobj) return False
def _file_does_exist(pathobj): if dom._exists(pathobj): dcm._fail("file does exist: " + pathobj) return True else: dcm._fail("file does not exist: " + pathobj) return False
def _exists_checks(): # these are special and should never be called directly print () print (" --- object existence checks --- ") print () _objadj = 'object does ' _objvrb = 'exist ' _objsep = ': ' print (" positive check ") print () obj = test_objects + '_exists' if dom._exists(obj): _bool = '' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._pass(msg) else: _bool = 'not ' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._fail(msg) raise SystemExit print () print (" negative check ") print () obj = test_objects + '_exists_not' if not dom._exists(obj): _bool = 'not ' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._pass(msg) else: _bool = '' msg = _objadj + _bool + _objvrb + _objsep + obj dcm._fail(msg) raise SystemExit
def _not_dir_exists(obj): _objadj = 'dir does ' _objvrb = {} _objvrb['exist'] = 'exist ' _objvrb['dir'] = 'a dir ' _objsep = ': ' if not (dom._exists(obj) and dom._isdir(obj)): _bool = 'not ' _junct = 'or is ' msg = _objadj + _bool + _objvrb['exist'] + _junct + _bool + _objvrb['dir'] + _objsep + obj dcm._info(msg) return True else: _bool = '' _junct = 'and is ' msg = _objadj + _bool + _objvrb['exist'] + _junct + _bool + _objvrb['dir'] + _objsep + obj dcm._info(msg) return False
def _not_dir_exists(obj): _objadj = 'dir does ' _objvrb = {} _objvrb['exist'] = 'exist ' _objvrb['dir'] = 'a dir ' _objsep = ': ' if not (dom._exists(obj) and dom._isdir(obj)): _bool = 'not ' _junct = 'or is ' msg = _objadj + _bool + _objvrb['exist'] + _junct + _bool + _objvrb[ 'dir'] + _objsep + obj dcm._info(msg) return True else: _bool = '' _junct = 'and is ' msg = _objadj + _bool + _objvrb['exist'] + _junct + _bool + _objvrb[ 'dir'] + _objsep + obj dcm._info(msg) return False
def _not_id_owns_checks(): print () print (" --- object id not owns checks --- ") print () _objadj = 'object is ' _objvrb = {} _objvrb['uid'] = 'owned by uid ' _objvrb['gid'] = 'owned by gid ' _objsep = ': ' print (" positive checks (uid)") print () obj = test_objects + '_id_uid_owns_not' # existence check is just for us if dom._exists(obj): if dom._not_id_owns(obj): _bool = 'not ' _junct = 'or is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._pass(msg) else: _bool = '' _junct = 'and is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit print () print (" positive checks (gid)") print () obj = test_objects + '_id_gid_owns_not' # existence check is just for us if dom._exists(obj): if dom._not_id_owns(obj): _bool = 'not ' _junct = 'or is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._pass(msg) else: _bool = '' _junct = 'and is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit print () print (" positive checks (uid and gid)") print () obj = test_objects + '_id_uid_gid_owns_not' # existence check is just for us if dom._exists(obj): if dom._not_id_owns(obj): _bool = 'not ' _junct = 'or is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._pass(msg) else: _bool = '' _junct = 'and is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit print () print (" negative check ") print () obj = test_objects + '_id_owns' # existence check is just for us if dom._exists(obj): if not dom._not_id_owns(obj): _bool = '' _junct = 'and is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._pass(msg) else: _bool = 'not ' _junct = 'or is ' msg = _objadj + _bool + _objvrb['uid'] + _junct + _bool + _objvrb['gid'] + _objsep + obj dcm._fail(msg) raise SystemExit else: dcm._halt("object is missing" + _objsep + obj) raise SystemExit