@@ -60,41 +60,6 @@ def _test_filestore_readwrite(
60
60
store .remove (path )
61
61
assert not store .exists (path ), f"{ path } is not removed"
62
62
63
- def _test_filestore_directory (
64
- self ,
65
- # pyre-fixme[2]
66
- store , # FileStore
67
- root_dir : Optional [str ] = None ,
68
- ) -> None :
69
- """
70
- Generic FileStore routines to test creating and removing directories
71
-
72
- Args:
73
- store (FileStore): The FileStore to test
74
- root_dir (str): The root directory to create
75
- """
76
- if root_dir is not None :
77
- root_dir += "/"
78
- else :
79
- root_dir = ""
80
-
81
- dir1 = f"{ '' .join (random .choices (string .ascii_letters , k = 15 ))} "
82
- dir2 = f"{ '' .join (random .choices (string .ascii_letters , k = 15 ))} "
83
-
84
- store .create_directory (f"{ root_dir } { dir1 } /{ dir2 } " )
85
- assert store .exists (
86
- f"{ root_dir } { dir1 } /{ dir2 } "
87
- ), f"Failed creating directories /{ dir1 } /{ dir2 } , directoies does not exist"
88
-
89
- store .remove_directory (f"{ root_dir } { dir1 } /{ dir2 } " )
90
- assert not store .exists (
91
- f"{ root_dir } { dir1 } /{ dir2 } "
92
- ), f"Failed removing directories /{ dir1 } /{ dir2 } , directory still exists"
93
- store .remove_directory (f"{ root_dir } { dir1 } " )
94
- assert not store .exists (
95
- f"{ root_dir } { dir1 } "
96
- ), f"Failed removing directories /{ dir1 } , directory still exists"
97
-
98
63
def test_filestore_oss_bad_bucket (self ) -> None :
99
64
"""
100
65
Test that OSS FileStore raises ValueError when an invalid bucket is provided
@@ -139,14 +104,6 @@ def test_filestore_oss_file(self) -> None:
139
104
140
105
self ._test_filestore_readwrite (FileStore ("/tmp" ), Path (infile .name ))
141
106
142
- def test_filestore_oss_directory (self ) -> None :
143
- """
144
- Test that OSS FileStore can create and remove directories
145
- """
146
- from fbgemm_gpu .utils import FileStore
147
-
148
- self ._test_filestore_directory (FileStore ("/tmp" ))
149
-
150
107
@unittest .skipIf (open_source , "Test does not apply to OSS" )
151
108
def test_filestore_fb_bad_bucket (self ) -> None :
152
109
"""
@@ -168,7 +125,7 @@ def test_filestore_fb_binaryio(self) -> None:
168
125
self ._test_filestore_readwrite (
169
126
FileStore ("tlparse_reports" ),
170
127
io .BytesIO ("" .join (random .choices (string .ascii_letters , k = 128 )).encode ()),
171
- f"tree/unit_tests/ { '' .join (random .choices (string .ascii_letters , k = 15 ))} .unittest" ,
128
+ f"tree/{ '' .join (random .choices (string .ascii_letters , k = 15 ))} .unittest" ,
172
129
)
173
130
174
131
@unittest .skipIf (open_source , "Test does not apply to OSS" )
@@ -181,7 +138,7 @@ def test_filestore_fb_tensor(self) -> None:
181
138
self ._test_filestore_readwrite (
182
139
FileStore ("tlparse_reports" ),
183
140
torch .rand ((random .randint (100 , 1000 ), random .randint (100 , 1000 ))),
184
- f"tree/unit_tests/ { '' .join (random .choices (string .ascii_letters , k = 15 ))} .unittest" ,
141
+ f"tree/{ '' .join (random .choices (string .ascii_letters , k = 15 ))} .unittest" ,
185
142
)
186
143
187
144
@unittest .skipIf (open_source , "Test does not apply to OSS" )
@@ -198,14 +155,5 @@ def test_filestore_fb_file(self) -> None:
198
155
self ._test_filestore_readwrite (
199
156
FileStore ("tlparse_reports" ),
200
157
Path (infile .name ),
201
- f"tree/unit_tests/ { '' .join (random .choices (string .ascii_letters , k = 15 ))} .unittest" ,
158
+ f"tree/{ '' .join (random .choices (string .ascii_letters , k = 15 ))} .unittest" ,
202
159
)
203
-
204
- @unittest .skipIf (open_source , "Test does not apply to OSS" )
205
- def test_filestore_fb_directory (self ) -> None :
206
- """
207
- Test that FB FileStore can create and remove directories
208
- """
209
- from fbgemm_gpu .fb .utils import FileStore
210
-
211
- self ._test_filestore_directory (FileStore ("tlparse_reports" ), "tree/unit_tests" )
0 commit comments