@@ -276,6 +276,21 @@ def test_module_path_in_module_dir_true_if_path_is_a_directory_and_parent_path_c
276276 assert module_path .in_module_dir () == True
277277
278278
279+ def test_module_path_is_module_file_true ():
280+ "sure.loader.ModulePath.is_module_file returns `True' when pointing to a path referencing a `*.py' file"
281+
282+ module_path = ModulePath (Path (__file__ ))
283+ assert module_path .is_module_file () == True
284+
285+
286+ def test_module_path_is_module_file_false_if_path_is_not_a_file ():
287+ "sure.loader.ModulePath.is_module_file returns `False' when pointing to a path not referencing a file"
288+
289+ path = Path (__file__ ).parent
290+ module_path = ModulePath (path )
291+ assert module_path .is_module_file () == False
292+
293+
279294def test_module_path_in_module_dir_false_if_path_does_not_contain_init_file ():
280295 "sure.loader.ModulePath.in_module_dir returns `False' when pointing to a path whose parent directory contains a __init__.py file"
281296
@@ -292,3 +307,32 @@ def test_module_path_in_module_dir_true_if_path_is_not_a_directory_and_parent_pa
292307
293308 module_path = ModulePath (sure .__file__ )
294309 assert module_path .in_module_dir () == True
310+
311+
312+ def test_module_path_is_module_file_true ():
313+ "sure.loader.ModulePath.is_module_file returns `True' when pointing to a path referencing a `*.py' file"
314+
315+ module_path = ModulePath (Path (__file__ ))
316+ assert module_path .is_module_file () == True
317+
318+
319+ def test_module_path_extension_returns_file_extension ():
320+ "sure.loader.ModulePath.is_module_file returns `False' when pointing to a path not referencing a file"
321+
322+ module_path = ModulePath (__file__ )
323+ assert ".py" in module_path .extension ()
324+
325+
326+
327+ def test_module_path_is_module_true_when_pointing_to_path_containing_init_file ():
328+ "sure.loader.ModulePath.is_module returns `True' when pointing to a path containing a __init__.py file"
329+
330+ module_path = ModulePath (Path (__file__ ).parent )
331+ assert module_path .is_module () == True
332+
333+
334+ def test_module_path_is_module_true_when_pointing_to_path_to_python_file ():
335+ "sure.loader.ModulePath.is_module returns `True' when pointing to a path referencing a `*.py' file"
336+
337+ module_path = ModulePath (Path (__file__ ).parent )
338+ assert module_path .is_module () == True
0 commit comments