Skip to content

Commit

Permalink
Remove unused exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Feb 4, 2024
1 parent 012eb9f commit 3d0d9ce
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
18 changes: 0 additions & 18 deletions mscxyz/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,6 @@
from mscxyz.score import Score


class ReadOnlyFieldError(Exception):
"""TODO remove: unused"""

def __init__(self, field: str) -> None:
self.msg = "The field “{}” is read only!".format(field)
Exception.__init__(self, self.msg)


class UnkownFieldError(Exception):
"""TODO remove: unused"""

def __init__(self, field: str, valid_fields: typing.Sequence[str]) -> None:
self.msg = "Unkown field of name “{}”! Valid field names are: {}".format(
field, ", ".join(valid_fields)
)
Exception.__init__(self, self.msg)


class UnmatchedFormatStringError(Exception):
def __init__(self, format_string: str, input_string: str) -> None:
self.msg = (
Expand Down
14 changes: 0 additions & 14 deletions tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@


class TestExceptions:
def test_read_only_field_error(self) -> None:
with pytest.raises(meta.ReadOnlyFieldError) as e:
raise meta.ReadOnlyFieldError("lol")
assert e.value.args[0] == "The field “lol” is read only!"

def test_unkown_field_error(self) -> None:
valid_fields = ("troll", "trill")
with pytest.raises(meta.UnkownFieldError) as e:
raise meta.UnkownFieldError("lol", valid_fields)
assert (
e.value.args[0] == "Unkown field of name “lol”! Valid field names are: "
"troll, trill"
)

def test_unmatched_format_string_error(self) -> None:
with pytest.raises(meta.UnmatchedFormatStringError) as e:
raise meta.UnmatchedFormatStringError("test", "test")
Expand Down

0 comments on commit 3d0d9ce

Please sign in to comment.