Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Nov 14, 2024
1 parent 7515426 commit 8ff0337
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion tests/test_method_getattribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,36 @@


def test_instance_get_dict():
class T:
from Python.Test import ClassTest
class T(ClassTest):
pass

t = T()
assert isinstance(t.__dict__, dict)


def test_instance_get_dict_with_type_field():
from Python.Test import ClassTest
from types import MappingProxyType
class T(ClassTest):
type_field = 42
pass

assert isinstance(T.__dict__, MappingProxyType)
assert 'type_field' in T.__dict__


def test_instance_get_dict_with_instance_field():
from Python.Test import ClassTest
class T(ClassTest):
def __init__(self):
self.instance_field = 42

t = T()
assert isinstance(t.__dict__, dict)
assert 'instance_field' in t.__dict__


def test_method_getattribute():
class S1(BASE):
def __getattribute__(self, name):
Expand Down

0 comments on commit 8ff0337

Please sign in to comment.