Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def error_check():
return [checks.Error("some error", id="tests.checks.E001")]
def test_check_message():
message = checks.Error("some error", level=100, id="tests.checks.E001")
assert str(message) == "?: (tests.checks.E001) some error"
assert message.is_serious()
obj = "test"
message = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert str(message) == "test: (tests.checks.E001) some error"
assert (
repr(message) == ""
)
message2 = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert message == message2
message3 = checks.Error("some error", level=101, id="tests.checks.E001", obj=obj)
assert message != message3
message = checks.Error("some error", level=100, id="tests.checks.E001")
assert str(message) == "?: (tests.checks.E001) some error"
assert message.is_serious()
obj = "test"
message = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert str(message) == "test: (tests.checks.E001) some error"
assert (
repr(message) == ""
)
message2 = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert message == message2
message3 = checks.Error("some error", level=101, id="tests.checks.E001", obj=obj)
assert message != message3
def test_check_message():
message = checks.Error("some error", level=100, id="tests.checks.E001")
assert str(message) == "?: (tests.checks.E001) some error"
assert message.is_serious()
obj = "test"
message = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert str(message) == "test: (tests.checks.E001) some error"
assert (
repr(message) == ""
)
message2 = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert message == message2
message3 = checks.Error("some error", level=101, id="tests.checks.E001", obj=obj)
assert message != message3
def test_check_message():
message = checks.Error("some error", level=100, id="tests.checks.E001")
assert str(message) == "?: (tests.checks.E001) some error"
assert message.is_serious()
obj = "test"
message = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert str(message) == "test: (tests.checks.E001) some error"
assert (
repr(message) == ""
)
message2 = checks.Error("some error", level=100, id="tests.checks.E001", obj=obj)
assert message == message2
message3 = checks.Error("some error", level=101, id="tests.checks.E001", obj=obj)
assert message != message3