# Path: vcfpy/record.py
# SNV = "SNV"
# MNV = "MNV"
# DEL = "DEL"
# INS = "INS"
# INDEL = "INDEL"
# SV = "SV"
# BND = "BND"
# SYMBOLIC = "SYMBOLIC"
# MIXED = "MIXED"
# HOM_REF = 0
# HET = 1
# HOM_ALT = 2
# RESERVED_CHARS = {"INFO": ";%,\r\n\t", "FORMAT": ":=%,\r\n\t"}
# ESCAPE_MAPPING = [
#     ("%", "%25"),
#     (":", "%3A"),
#     (";", "%3B"),
#     ("=", "%3D"),
#     (",", "%2C"),
#     ("\r", "%0D"),
#     ("\n", "%0A"),
#     ("\t", "%09"),
# ]
# UNESCAPE_MAPPING = [(v, k) for k, v in ESCAPE_MAPPING]
#         BAD_MIX = {INS, SV, BND, SYMBOLIC}  # don't mix well with others
#         BAD_MIX = {INS, SV, BND, SYMBOLIC}  # don't mix well with others
# ALLELE_DELIM = re.compile(r"[|/]")
# FIVE_PRIME = "5"
# THREE_PRIME = "3"
# FORWARD = "+"
# REVERSE = "-"
# class Record:
# class UnparsedCall:
# class Call:
# class AltRecord:
# class Substitution(AltRecord):
# class BreakEnd(AltRecord):
# class SingleBreakEnd(BreakEnd):
# class SymbolicAllele(AltRecord):
#     def __init__(self, CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO, FORMAT=None, calls=None):
#     def update_calls(self, calls):
#     def is_snv(self):
#     def affected_start(self):
#     def affected_end(self):
#     def add_filter(self, label):
#     def add_format(self, key, value=None):
#     def __iter__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, sample, unparsed_data, site=None):
#     def __init__(self, sample, data, site=None):
#     def set_genotype(self, genotype):
#     def _genotype_updated(self):
#     def is_phased(self):
#     def gt_phase_char(self):
#     def gt_bases(self):
#     def gt_type(self):
#     def is_filtered(self, require=None, ignore=None):
#     def is_het(self):
#     def is_variant(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, type_=None):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def serialize(self):
#     def __init__(self, type_, value):
#     def serialize(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(
#         self, mate_chrom, mate_pos, orientation, mate_orientation, sequence, within_main_assembly
#     ):
#     def serialize(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, orientation, sequence):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __init__(self, value):
#     def serialize(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):


import vcfpy
from vcfpy import record

def test_is_het_het():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0|1")]))
    assert call.is_het


def test_is_het_hom_ref():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0/0")]))
    assert not call.is_het


def test_is_het_hom_alt():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "1/1")]))
    assert not call.is_het


# Call.is_variant() -----------------------------------------------------------


def test_is_variant_het():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0|1")]))
    assert call.is_variant


def test_is_variant_hom_ref():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0/0")]))
    assert not call.is_variant


def test_is_variant_hom_alt():

# Path: vcfpy/record.py
# SNV = "SNV"
# MNV = "MNV"
# DEL = "DEL"
# INS = "INS"
# INDEL = "INDEL"
# SV = "SV"
# BND = "BND"
# SYMBOLIC = "SYMBOLIC"
# MIXED = "MIXED"
# HOM_REF = 0
# HET = 1
# HOM_ALT = 2
# RESERVED_CHARS = {"INFO": ";%,\r\n\t", "FORMAT": ":=%,\r\n\t"}
# ESCAPE_MAPPING = [
#     ("%", "%25"),
#     (":", "%3A"),
#     (";", "%3B"),
#     ("=", "%3D"),
#     (",", "%2C"),
#     ("\r", "%0D"),
#     ("\n", "%0A"),
#     ("\t", "%09"),
# ]
# UNESCAPE_MAPPING = [(v, k) for k, v in ESCAPE_MAPPING]
#         BAD_MIX = {INS, SV, BND, SYMBOLIC}  # don't mix well with others
#         BAD_MIX = {INS, SV, BND, SYMBOLIC}  # don't mix well with others
# ALLELE_DELIM = re.compile(r"[|/]")
# FIVE_PRIME = "5"
# THREE_PRIME = "3"
# FORWARD = "+"
# REVERSE = "-"
# class Record:
# class UnparsedCall:
# class Call:
# class AltRecord:
# class Substitution(AltRecord):
# class BreakEnd(AltRecord):
# class SingleBreakEnd(BreakEnd):
# class SymbolicAllele(AltRecord):
#     def __init__(self, CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO, FORMAT=None, calls=None):
#     def update_calls(self, calls):
#     def is_snv(self):
#     def affected_start(self):
#     def affected_end(self):
#     def add_filter(self, label):
#     def add_format(self, key, value=None):
#     def __iter__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, sample, unparsed_data, site=None):
#     def __init__(self, sample, data, site=None):
#     def set_genotype(self, genotype):
#     def _genotype_updated(self):
#     def is_phased(self):
#     def gt_phase_char(self):
#     def gt_bases(self):
#     def gt_type(self):
#     def is_filtered(self, require=None, ignore=None):
#     def is_het(self):
#     def is_variant(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, type_=None):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def serialize(self):
#     def __init__(self, type_, value):
#     def serialize(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(
#         self, mate_chrom, mate_pos, orientation, mate_orientation, sequence, within_main_assembly
#     ):
#     def serialize(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, orientation, sequence):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __init__(self, value):
#     def serialize(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def __str__(self):
#     def __repr__(self):


# Path: tests/test_call.py
import vcfpy
from vcfpy import record


def test_is_het_het():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0|1")]))
    assert call.is_het


def test_is_het_hom_ref():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0/0")]))
    assert not call.is_het


def test_is_het_hom_alt():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "1/1")]))
    assert not call.is_het


# Call.is_variant() -----------------------------------------------------------


def test_is_variant_het():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0|1")]))
    assert call.is_variant


def test_is_variant_hom_ref():
    call = record.Call("sample", vcfpy.OrderedDict([("GT", "0/0")]))
    assert not call.is_variant


def test_is_variant_hom_alt():

    call = record.Call("sample", vcfpy.OrderedDict([("GT", "1/1")]))