@@ -259,18 +259,62 @@ def test_isfile_true(self):
259
259
"""
260
260
Test isfile for an existing file.
261
261
"""
262
- filename = "/etc/hosts"
262
+ filename = __file__
263
263
264
264
response = self .operations .isfile (filename )
265
265
266
266
assert response is True
267
267
268
- def test_isfile_false (self ):
268
+ def test_isfile_false__not_exist (self ):
269
269
"""
270
270
Test isfile for a non-existing file.
271
271
"""
272
- filename = "/ nonexistent_file.txt"
272
+ filename = os . path . join ( os . path . dirname ( __file__ ), " nonexistent_file.txt")
273
273
274
274
response = self .operations .isfile (filename )
275
275
276
276
assert response is False
277
+
278
+ def test_isfile_false__directory (self ):
279
+ """
280
+ Test isfile for a firectory.
281
+ """
282
+ name = os .path .dirname (__file__ )
283
+
284
+ assert self .operations .isdir (name )
285
+
286
+ response = self .operations .isfile (name )
287
+
288
+ assert response is False
289
+
290
+ def test_isdir_true (self ):
291
+ """
292
+ Test isdir for an existing directory.
293
+ """
294
+ name = os .path .dirname (__file__ )
295
+
296
+ response = self .operations .isdir (name )
297
+
298
+ assert response is True
299
+
300
+ def test_isdir_false__not_exist (self ):
301
+ """
302
+ Test isdir for a non-existing directory.
303
+ """
304
+ name = os .path .join (os .path .dirname (__file__ ), "it_is_nonexistent_directory" )
305
+
306
+ response = self .operations .isdir (name )
307
+
308
+ assert response is False
309
+
310
+ def test_isdir_false__file (self ):
311
+ """
312
+ Test isdir for a file.
313
+ """
314
+ name = __file__
315
+
316
+ assert self .operations .isfile (name )
317
+
318
+ response = self .operations .isdir (name )
319
+
320
+ assert response is False
0 commit comments