# Path: vcfpy/reader.py
# class Reader:
#     def from_stream(
#         klass, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None
#     ):
#     def from_path(klass, path, tabix_path=None, record_checks=None, parsed_samples=None):
#     def __init__(self, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None):
#     def fetch(self, chrom_or_region, begin=None, end=None):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def __iter__(self):
#     def __next__(self):


import os
from vcfpy import reader
def test_read_text():
    path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43.vcf")
    r = reader.Reader.from_path(path)
    assert r.parser
    assert r.header
    assert len(r.header.lines) == 18
    assert r.header.samples
    assert r.header.samples.names == ["NA00001", "NA00002", "NA00003"]
    records = []
    for record in r:
        records.append(record)
    assert len(records) == 5


def test_read_bgzip():
    path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43.vcf.gz")
    r = reader.Reader.from_path(path)
    assert r.parser
    assert r.header
    assert len(r.header.lines) == 18
    assert r.header.samples
    assert r.header.samples.names == ["NA00001", "NA00002", "NA00003"]
    records = []
    for record in r:
        records.append(record)
    assert len(records) == 5


def test_read_text_no_samples():
    path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43_no_samples.vcf")

# Path: vcfpy/reader.py
# class Reader:
#     def from_stream(
#         klass, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None
#     ):
#     def from_path(klass, path, tabix_path=None, record_checks=None, parsed_samples=None):
#     def __init__(self, stream, path=None, tabix_path=None, record_checks=None, parsed_samples=None):
#     def fetch(self, chrom_or_region, begin=None, end=None):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, type_, value, traceback):
#     def __iter__(self):
#     def __next__(self):


# Path: tests/test_reader_read_file.py
import os
from vcfpy import reader

def test_read_text():
    path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43.vcf")
    r = reader.Reader.from_path(path)
    assert r.parser
    assert r.header
    assert len(r.header.lines) == 18
    assert r.header.samples
    assert r.header.samples.names == ["NA00001", "NA00002", "NA00003"]
    records = []
    for record in r:
        records.append(record)
    assert len(records) == 5


def test_read_bgzip():
    path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43.vcf.gz")
    r = reader.Reader.from_path(path)
    assert r.parser
    assert r.header
    assert len(r.header.lines) == 18
    assert r.header.samples
    assert r.header.samples.names == ["NA00001", "NA00002", "NA00003"]
    records = []
    for record in r:
        records.append(record)
    assert len(records) == 5


def test_read_text_no_samples():
    path = os.path.join(os.path.dirname(__file__), "vcfs/full_vcf43_no_samples.vcf")

    r = reader.Reader.from_path(path)