@@ -48,48 +48,43 @@ def _attach_item(path, name):
4848
4949 def _base_test (self , path , item ):
5050 with sa .item_context (path , item , overwrite = True ) as ic :
51- print (1111111 )
5251 ic .set_component_value ("component_id_1" , None )
5352 with sa .item_context (path , item , overwrite = False ) as ic :
54- print (222222 )
5553 assert ic .get_component_value ("component_id_1" ) is None
56- print (333333 )
5754 ic .set_component_value ("component_id_1" , "value" )
5855 with self .assertRaisesRegexp (
5956 FileChangedError , "The file has changed and overwrite is set to False."
6057 ):
6158 with sa .item_context (path , item , overwrite = False ) as ic :
62- print (4444444 )
6359 assert ic .get_component_value ("component_id_1" ) == "value"
6460 sa .item_context (path , item , overwrite = True ).set_component_value (
6561 "component_id_1" , "to crash"
6662 ).save ()
67- print (555555 )
6863 ic .set_component_value ("component_id_1" , "value" )
6964
7065 def test_overwrite_false (self ):
7166 # test root by folder name
7267 self ._attach_item (self .PROJECT_NAME , "dummy" )
7368 time .sleep (2 )
7469 self ._base_test (self .PROJECT_NAME , "dummy" )
75- #
76- # folder = sa.create_folder(self.PROJECT_NAME, folder_name="folder")
77- # # test from folder by project and folder names
78- # time.sleep(2)
79- # path = f"{self.PROJECT_NAME}/folder"
80- # self._attach_item(path, "dummy")
81- # self._base_test(path, "dummy")
82- #
83- # # test from folder by project and folder names as tuple
84- # path = (self.PROJECT_NAME, ' folder' )
85- # self._base_test(path, "dummy")
86- #
87- # # test from folder by project and folder ids as tuple item name as dict
88- # self._base_test((self._project['id' ], folder['id' ]), "dummy")
89- #
90- # # test from folder by project and folder ids as tuple and item id
91- # item = sa.search_items(f"{self.PROJECT_NAME}/folder", "dummy")[0]
92- # self._base_test((self._project['id' ], folder['id' ]), item['id' ])
70+
71+ folder = sa .create_folder (self .PROJECT_NAME , folder_name = "folder" )
72+ # test from folder by project and folder names
73+ time .sleep (2 )
74+ path = f"{ self .PROJECT_NAME } /folder"
75+ self ._attach_item (path , "dummy" )
76+ self ._base_test (path , "dummy" )
77+
78+ # test from folder by project and folder names as tuple
79+ path = (self .PROJECT_NAME , " folder" )
80+ self ._base_test (path , "dummy" )
81+
82+ # test from folder by project and folder ids as tuple item name as dict
83+ self ._base_test ((self ._project ["id" ], folder ["id" ]), "dummy" )
84+
85+ # test from folder by project and folder ids as tuple and item id
86+ item = sa .search_items (f"{ self .PROJECT_NAME } /folder" , "dummy" )[0 ]
87+ self ._base_test ((self ._project ["id" ], folder ["id" ]), item ["id" ])
9388
9489
9590def test_ ():
0 commit comments