This commit is contained in:
@@ -88,20 +88,17 @@ def test_rich_inspector_outputs_more_than_builtin(monkeypatch):
|
||||
# role = 'admin'
|
||||
assert "age = 30" in rich_text
|
||||
assert "name = 'Alice'" in rich_text
|
||||
assert "role = 'admin'" in rich_text
|
||||
|
||||
# Built-in inspector does NOT show instance values
|
||||
assert "30" not in builtin_text
|
||||
assert "Alice" not in builtin_text
|
||||
assert "admin" not in builtin_text
|
||||
|
||||
# # Built-in inspector only shows the brut init function
|
||||
assert "def __init__(self, name: str, age: int):" in builtin_text
|
||||
assert "self.name = name" in builtin_text
|
||||
assert "self.age = age" in builtin_text
|
||||
|
||||
|
||||
# Both outputs include the same method and documentation
|
||||
# Both outputs include the same method and documentation and gives us the texts written outside functions
|
||||
|
||||
# Method name is visible in both
|
||||
assert "def greet():" in rich_text
|
||||
@@ -111,6 +108,10 @@ def test_rich_inspector_outputs_more_than_builtin(monkeypatch):
|
||||
assert "Returns a welcome message." in rich_text
|
||||
assert "Returns a welcome message." in builtin_text
|
||||
|
||||
# Informations outside functions are visible in both
|
||||
assert "role = 'admin'" in rich_text
|
||||
assert "role = 'admin'" in builtin_text
|
||||
|
||||
# Class docstring is shown in both
|
||||
assert "Represents a user in the system." in rich_text
|
||||
assert "Represents a user in the system." in builtin_text
|
||||
|
||||
Reference in New Issue
Block a user