# Path: ciao_contrib/_tools/obsinfo.py
# def _remove_dmfilter(fname):
# def normalize_path(fname, start='.'):
#     def __init__(self, infile):
#     def __str__(self):
#     def evtfile(self):
#     def get_evtfile(self):
#     def get_evtfile_no_dmfilter(self):
#     def get_header(self):
#     def get_keyword(self, key):
#     def has_column(self, colname):
#     def get_colnames(self):
#     def get_columns(self):
#     def instrument(self):
#     def detector(self):
#     def grating(self):
#     def tstart(self):
#     def tstop(self):
#     def obsid(self):
#     def aimpoint(self):
#     def tangentpoint(self):
#     def nrows(self):
#     def get_chipname(self):
#     def get_asol_(self, indir='.'):
#     def get_asol(self, indir='.'):
#     def _validate_ancillary_type(self, atype):
#     def get_ancillary_(self, atype, indir='.'):
#     def get_ancillary(self, atype, indir='.'):
#     def set_asol(self, asolfiles):
#     def set_ancillary(self, atype, aname):
# class ObsInfo:


import os
import pytest
from pathlib import Path
from ciao_contrib._tools import obsinfo
"""test ciao_contrib._tools.obsinfo"""





def test_normalize_path_not_absolute():
    with pytest.raises(ValueError) as ve:
        obsinfo.normalize_path('foo/bar')

    assert str(ve.value) == "Expected an absolute path for fname=foo/bar"


def test_normalize_path_in_cwd():
    cwd = os.getcwd()
    infile = f'{cwd}/foo/bar.fits'


# Path: ciao_contrib/_tools/obsinfo.py
# def _remove_dmfilter(fname):
# def normalize_path(fname, start='.'):
#     def __init__(self, infile):
#     def __str__(self):
#     def evtfile(self):
#     def get_evtfile(self):
#     def get_evtfile_no_dmfilter(self):
#     def get_header(self):
#     def get_keyword(self, key):
#     def has_column(self, colname):
#     def get_colnames(self):
#     def get_columns(self):
#     def instrument(self):
#     def detector(self):
#     def grating(self):
#     def tstart(self):
#     def tstop(self):
#     def obsid(self):
#     def aimpoint(self):
#     def tangentpoint(self):
#     def nrows(self):
#     def get_chipname(self):
#     def get_asol_(self, indir='.'):
#     def get_asol(self, indir='.'):
#     def _validate_ancillary_type(self, atype):
#     def get_ancillary_(self, atype, indir='.'):
#     def get_ancillary(self, atype, indir='.'):
#     def set_asol(self, asolfiles):
#     def set_ancillary(self, atype, aname):
# class ObsInfo:


# Path: ciao_contrib/_tools/tests/test_ciao_contrib_tools_obsinfo.py
import os
import pytest
from pathlib import Path
from ciao_contrib._tools import obsinfo

"""test ciao_contrib._tools.obsinfo"""





def test_normalize_path_not_absolute():
    with pytest.raises(ValueError) as ve:
        obsinfo.normalize_path('foo/bar')

    assert str(ve.value) == "Expected an absolute path for fname=foo/bar"


def test_normalize_path_in_cwd():
    cwd = os.getcwd()
    infile = f'{cwd}/foo/bar.fits'


    ans = obsinfo.normalize_path(infile)