def test_atrs(self): fdict = FrozenDict({"a": 1}) for atr in ("keys", "items", "values"): try: getattr(fdict, atr) assert True except: assert False
AttrKeyField, VariableKeyField, DimensionKeyField, ) from segysak._seismic_dataset import ( create_seismic_dataset, create3d_dataset, _dataset_coordinate_helper, ) # from segysak.seisnc import create_empty_seisnc, set_seisnc_dims from segysak.tools import check_crop, check_zcrop from segysak._accessor import open_seisnc from segysak._core import FrozenDict KNOWN_BYTES = FrozenDict(KNOWN_BYTES) from ._segy_headers import segy_bin_scrape, segy_header_scrape, what_geometry_am_i from ._segy_text import get_segy_texthead from ._segy_globals import _SEGY_MEASUREMENT_SYSTEM class SegyLoadError(Exception): def __init__(self, message, errors): # Call the base class constructor with the parameters it needs super().__init__(message) # Now for your custom code... self.errors = errors
def test_init(self): fdict = FrozenDict({"a": 1}) assert isinstance(fdict, FrozenDict)
def test_fromkeys(self): fdict = FrozenDict().fromkeys(["a"], [1]) assert isinstance(fdict, FrozenDict)
def test_repr(self): fdict = FrozenDict({"a": 1}) assert isinstance(str(fdict), str)
def test_hash(self): fdict = FrozenDict({"a": 1}) assert isinstance(fdict.__hash__(), int)
def test_removed_atrs(self): fdict = FrozenDict({"a": 1}) for atr in ("clear", "update", "pop", "popitem", "setdefault"): with pytest.raises(AttributeError): getattr(fdict, atr)
def test_del_item(self): fdict = FrozenDict({"a": 1}) with pytest.raises(TypeError): del fdict["a"]
def test_noset_item(self): fdict = FrozenDict({"a": 1}) with pytest.raises(TypeError): fdict["b"] = 2