# Mutations the wikitree tests must catch (format: see read/mutants.txt).
gwt_wikitree.py | return API + '?' + urllib.parse.urlencode(list(params) + [('appId', APP_ID), ('fields', FIELDS)]) | return API + '?' + urllib.parse.urlencode(list(params) + [('fields', FIELDS)]) | every WikiTree call names the app with appId, as WikiTree asks
gwt_wikitree.py | return isinstance(p, dict) and p.get('Privacy_IsAtLeastPublic') is True | return isinstance(p, dict) | a private WikiTree profile never becomes a candidate
gwt_wikitree.py | return 'unknown'    # an error status, or the result container renamed: a STOP | return 'none' | a WikiTree answer whose container changed is unknown, a STOP, never "none"
gwt_wikitree.py | if n == 0 and not d['matches']: | if not d['matches']: | a count above zero with no rows is unknown, never "none"
gwt_wikitree.py | if isinstance(d.get('status'), str) and 'invalid' in d['status'].lower(): | if False: | the site's own "Invalid WikiTree ID" is "none" (exit 2), not a STOP
gwt_wikitree.py | ('ancestors', max(1, min(int(ancestors), 10))) | ('ancestors', max(1, int(ancestors))) | --ancestors never asks for more than 10 generations
gwt_wikitree.py | return y or None | return y | an unknown WikiTree date (0000-00-00) is no year, never year 0
gwt_wikitree.py | if other: | if True: | a parent who is private, or not in the answer, is never listed as a relative
gwt_wikitree.py | q.append(('dateInclude', 'both'))   # else WikiTree also returns every profile with no date at all | pass | --born and --died keep only profiles with the dates; without dateInclude=both WikiTree returns undated ones too
gwt_wikitree.py | (m.get('Name') or m.get('Id')) | m.get('Name') | a private WikiTree profile comes as {Id, index} alone: withheld, never a STOP of the whole search
gwt_wikitree.py | m = _KEY.search(urllib.parse.unquote((arg or '').strip())) | m = _KEY.search((arg or '').strip()) | a percent-encoded profile URL from a browser is decoded once, never sent encoded twice as a false "none"
gwt_wikitree.py | c.update(role='ancestor', principal=False, generation=name_gen.get(c['id'])) | pass | with --ancestors only the asked profile is the principal; the others are ancestors with their generation
gwt_wikitree.py | if not isinstance(n, int) or isinstance(n, bool): | if False: | a search answer whose count is not a whole number is unknown, a STOP
gwt_wikitree.py | if not isinstance(d['people'], (dict, list)): | if False: | a getPeople answer whose people is of another type is unknown, a STOP
gwt_wikitree.py | return 'hits' if d['people'] else 'none' | return 'hits' | a getPeople answer with no person is "none" (exit 2)
gwt_wikitree.py | if d.get('status') == 0 and isinstance(d.get('profile'), dict): | if isinstance(d.get('profile'), dict): | a getProfile answer with an error status is unknown, never a profile
gwt_wikitree.py | if is_public(p) and p.get('Name')] | if is_public(p)] | a public profile without its WikiTree ID is withheld, never a crash
gwt_wikitree.py | return sorted(cands, key=lambda c: not c['principal']) | return cands | with --ancestors the asked profile comes first whatever the answer's order
gwt_wikitree.py | gen[parent] = gen[p.get('Id')] + 1 | gen[parent] = 1 | a grandparent is generation 2, not 1
