22from apysc ._display .flip_y_mixin import FlipYMixIn
33from apysc ._expression import expression_data_util
44from apysc ._testing .testing_helper import apply_test_settings
5+ from apysc ._type .variable_name_mixin import VariableNameMixIn
6+ from apysc ._type .variable_name_suffix_attr_or_var_mixin import (
7+ VariableNameSuffixAttrOrVarMixIn ,
8+ )
9+ from apysc ._type .variable_name_suffix_mixin import VariableNameSuffixMixIn
510
611
7- class _TestInterface (FlipYMixIn ):
12+ class _TestObject (
13+ FlipYMixIn ,
14+ VariableNameMixIn ,
15+ VariableNameSuffixMixIn ,
16+ VariableNameSuffixAttrOrVarMixIn ,
17+ ):
818 def __init__ (self ) -> None :
919 """
1020 The class for the testing of the FlipYMixIn.
@@ -15,59 +25,59 @@ def __init__(self) -> None:
1525class TestFlipYMixIn :
1626 @apply_test_settings ()
1727 def test__initialize_flip_y_if_not_initialized (self ) -> None :
18- interface : _TestInterface = _TestInterface ()
19- interface ._initialize_flip_y_if_not_initialized ()
20- assert not interface ._flip_y
28+ instance : _TestObject = _TestObject ()
29+ instance ._initialize_flip_y_if_not_initialized ()
30+ assert not instance ._flip_y
2131
22- interface ._flip_y ._value = True
23- interface ._initialize_flip_y_if_not_initialized ()
24- assert interface ._flip_y
32+ instance ._flip_y ._value = True
33+ instance ._initialize_flip_y_if_not_initialized ()
34+ assert instance ._flip_y
2535
2636 @apply_test_settings ()
2737 def test_flip_y (self ) -> None :
28- interface : _TestInterface = _TestInterface ()
29- assert not interface .flip_y
38+ instance : _TestObject = _TestObject ()
39+ assert not instance .flip_y
3040
31- interface .flip_y = ap .Boolean (True )
32- assert interface .flip_y
41+ instance .flip_y = ap .Boolean (True )
42+ assert instance .flip_y
3343
3444 @apply_test_settings ()
3545 def test__append_flip_y_update_expression (self ) -> None :
36- interface : _TestInterface = _TestInterface ()
37- interface .flip_y = ap .Boolean (True )
46+ instance : _TestObject = _TestObject ()
47+ instance .flip_y = ap .Boolean (True )
3848 expression : str = expression_data_util .get_current_expression ()
3949 assert '.flip("y");' in expression
4050
4151 @apply_test_settings ()
4252 def test__make_snapshot (self ) -> None :
43- interface : _TestInterface = _TestInterface ()
44- interface .flip_y = ap .Boolean (True )
45- snapshot_name : str = interface ._get_next_snapshot_name ()
46- interface ._run_all_make_snapshot_methods (snapshot_name = snapshot_name )
47- if interface ._flip_y_snapshots is None :
53+ instance : _TestObject = _TestObject ()
54+ instance .flip_y = ap .Boolean (True )
55+ snapshot_name : str = instance ._get_next_snapshot_name ()
56+ instance ._run_all_make_snapshot_methods (snapshot_name = snapshot_name )
57+ if instance ._flip_y_snapshots is None :
4858 raise AssertionError ()
49- assert interface ._flip_y_snapshots [snapshot_name ]
59+ assert instance ._flip_y_snapshots [snapshot_name ]
5060
51- interface .flip_y = ap .Boolean (False )
52- interface ._run_all_make_snapshot_methods (snapshot_name = snapshot_name )
53- assert interface ._flip_y_snapshots [snapshot_name ]
61+ instance .flip_y = ap .Boolean (False )
62+ instance ._run_all_make_snapshot_methods (snapshot_name = snapshot_name )
63+ assert instance ._flip_y_snapshots [snapshot_name ]
5464
5565 @apply_test_settings ()
5666 def test__revert (self ) -> None :
57- interface : _TestInterface = _TestInterface ()
58- interface .flip_y = ap .Boolean (True )
59- snapshot_name : str = interface ._get_next_snapshot_name ()
60- interface ._run_all_make_snapshot_methods (snapshot_name = snapshot_name )
61- interface .flip_y = ap .Boolean (False )
62- interface ._run_all_revert_methods (snapshot_name = snapshot_name )
63- assert interface .flip_y
67+ instance : _TestObject = _TestObject ()
68+ instance .flip_y = ap .Boolean (True )
69+ snapshot_name : str = instance ._get_next_snapshot_name ()
70+ instance ._run_all_make_snapshot_methods (snapshot_name = snapshot_name )
71+ instance .flip_y = ap .Boolean (False )
72+ instance ._run_all_revert_methods (snapshot_name = snapshot_name )
73+ assert instance .flip_y
6474
65- interface .flip_y = ap .Boolean (False )
66- interface ._run_all_revert_methods (snapshot_name = snapshot_name )
67- assert not interface .flip_y
75+ instance .flip_y = ap .Boolean (False )
76+ instance ._run_all_revert_methods (snapshot_name = snapshot_name )
77+ assert not instance .flip_y
6878
6979 @apply_test_settings ()
7080 def test__append_flip_y_attr_linking_setting (self ) -> None :
71- interface : _TestInterface = _TestInterface ()
72- interface ._initialize_flip_y_if_not_initialized ()
73- assert interface ._attr_linking_stack ["flip_y" ] == [ap .Boolean (False )]
81+ instance : _TestObject = _TestObject ()
82+ instance ._initialize_flip_y_if_not_initialized ()
83+ assert instance ._attr_linking_stack ["flip_y" ] == [ap .Boolean (False )]
0 commit comments