44
55
66class TestDirectoriesHelper (unittest .TestCase ):
7+ """
8+ Unit tests for the directories helper module.
9+ """
710 def test_strip_trailing_slash (self ):
8- """test strip trailing slash """
11+ """Test the strip_trailing_slash function. """
912 test_dir = '/a/'
1013 expect = '/a'
1114 result = directories .strip_trailing_slash (test_dir )
1215
1316 self .assertEqual (expect , result )
1417
1518 def test_skip_strip_trailing_slash (self ):
16- """test skip strip trailing slash when not necessary"""
19+ """Test skipping strip_trailing_slash when not necessary. """
1720 test_dir = '/a'
1821 result = directories .strip_trailing_slash (test_dir )
1922
2023 self .assertEqual (result , test_dir )
2124
2225 def test_add_trailing_slash (self ):
23- """test add trailing slash """
26+ """Test the add_trailing_slash function. """
2427 test_dir = '/a'
2528 expect = '/a/'
2629 result = directories .add_trailing_slash (test_dir )
2730
2831 self .assertEqual (expect , result )
2932
3033 def test_skip_add_trailing_slash (self ):
31- """test skip add trailing slash when not necessary"""
34+ """Test skipping add_trailing_slash when not necessary. """
3235 test_dir = '/a/'
3336 result = directories .add_trailing_slash (test_dir )
3437
3538 self .assertEqual (result , test_dir )
3639
3740 def test_sanitize_trailing_slash (self ):
38- """test sanitize trailing slash when syncing source contents"""
41+ """Test sanitizing trailing slash when syncing source contents. """
3942 source , target = '/a' , '/b/'
4043 expect_source , expect_target = '/a/' , '/b'
4144 result_source , result_target = directories .sanitize_trailing_slash (
@@ -45,7 +48,7 @@ def test_sanitize_trailing_slash(self):
4548 self .assertEqual (expect_target , result_target )
4649
4750 def test_sanitize_trailing_slash_no_action_needed (self ):
48- """test sanitize trailing slash when syncing source contents when already sanitized"""
51+ """Test sanitizing trailing slash when syncing source contents when already sanitized. """
4952 source , target = '/a/' , '/b'
5053 expect_source , expect_target = '/a/' , '/b'
5154 result_source , result_target = directories .sanitize_trailing_slash (
@@ -55,7 +58,7 @@ def test_sanitize_trailing_slash_no_action_needed(self):
5558 self .assertEqual (expect_target , result_target )
5659
5760 def test_sanitize_trailing_slash_whole_source (self ):
58- """test sanitize trailing slash when syncing whole source"""
61+ """Test sanitizing trailing slash when syncing whole source. """
5962 source , target = '/a/' , '/b/'
6063 expect_source , expect_target = '/a' , '/b'
6164 result_source , result_target = directories .sanitize_trailing_slash (
@@ -65,7 +68,7 @@ def test_sanitize_trailing_slash_whole_source(self):
6568 self .assertEqual (expect_target , result_target )
6669
6770 def test_sanitize_trailing_slash_whole_source_no_action_needed (self ):
68- """test sanitize trailing slash when syncing whole source when already sanitized"""
71+ """Test sanitizing trailing slash when syncing whole source when already sanitized. """
6972 source , target = '/a' , '/b/'
7073 expect_source , expect_target = '/a' , '/b'
7174 result_source , result_target = directories .sanitize_trailing_slash (
@@ -75,7 +78,7 @@ def test_sanitize_trailing_slash_whole_source_no_action_needed(self):
7578 self .assertEqual (expect_target , result_target )
7679
7780 def test_dir_with_ssh (self ):
78- """should compose string with ssh for rsync connection"""
81+ """Test composing string with ssh for rsync connection. """
7982 directory = '/a'
8083 ssh = 'host'
8184 expect = 'host:/a'
@@ -84,7 +87,7 @@ def test_dir_with_ssh(self):
8487 self .assertEqual (result , expect )
8588
8689 def test_dir_without_ssh (self ):
87- """should return directory when ssh is None"""
90+ """Test returning directory when ssh is None. """
8891 directory = '/a'
8992 ssh = None
9093 result = directories .get_directory_with_ssh (directory , ssh )
0 commit comments