|
@@ 81-107 (lines=27) @@
|
| 78 |
|
self.assertEqual(indention_depth, (1, INDENT.IndentType.FoldMarker, 1)) |
| 79 |
|
|
| 80 |
|
|
| 81 |
|
class TestCalcLineIndentionDepthFromSection(TestCase): |
| 82 |
|
""".""" |
| 83 |
|
|
| 84 |
|
def test_with_empty_line(self): |
| 85 |
|
line = "" |
| 86 |
|
indention_depth = indention_depth_from_section(line) |
| 87 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.Section, 1)) |
| 88 |
|
|
| 89 |
|
def test_with_comment(self): |
| 90 |
|
line = "; This is a comment" |
| 91 |
|
indention_depth = indention_depth_from_section(line) |
| 92 |
|
self.assertEqual(indention_depth, (1, INDENT.IndentType.Section, 1)) |
| 93 |
|
|
| 94 |
|
def test_with_fold_marker(self): |
| 95 |
|
line = ";; This is a fold marker" |
| 96 |
|
indention_depth = indention_depth_from_section(line) |
| 97 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.FoldMarker, 1)) |
| 98 |
|
|
| 99 |
|
def test_with_section(self): |
| 100 |
|
line = "[Section]" |
| 101 |
|
indention_depth = indention_depth_from_section(line) |
| 102 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.Section, 1)) |
| 103 |
|
|
| 104 |
|
def test_with_key_value(self): |
| 105 |
|
line = "Key = Value" |
| 106 |
|
indention_depth = indention_depth_from_section(line) |
| 107 |
|
self.assertEqual(indention_depth, (1, INDENT.IndentType.Section, 1)) |
| 108 |
|
|
| 109 |
|
|
| 110 |
|
class TestIndentWholeSection(TestCase): |
|
@@ 52-78 (lines=27) @@
|
| 49 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.Initial, 0)) |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
class TestCalcLineIndentionDepthFromFoldMarker(TestCase): |
| 53 |
|
""".""" |
| 54 |
|
|
| 55 |
|
def test_with_empty_line(self): |
| 56 |
|
line = "" |
| 57 |
|
indention_depth = indention_depth_from_fold(line) |
| 58 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.FoldMarker, 1)) |
| 59 |
|
|
| 60 |
|
def test_with_comment(self): |
| 61 |
|
line = "; This is a comment" |
| 62 |
|
indention_depth = indention_depth_from_fold(line) |
| 63 |
|
self.assertEqual(indention_depth, (1, INDENT.IndentType.FoldMarker, 1)) |
| 64 |
|
|
| 65 |
|
def test_with_fold_marker(self): |
| 66 |
|
line = ";; This is a fold marker" |
| 67 |
|
indention_depth = indention_depth_from_fold(line) |
| 68 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.FoldMarker, 1)) |
| 69 |
|
|
| 70 |
|
def test_with_section(self): |
| 71 |
|
line = "[Section]" |
| 72 |
|
indention_depth = indention_depth_from_fold(line) |
| 73 |
|
self.assertEqual(indention_depth, (1, INDENT.IndentType.Section, 2)) |
| 74 |
|
|
| 75 |
|
def test_with_key_value(self): |
| 76 |
|
line = "Key = Value" |
| 77 |
|
indention_depth = indention_depth_from_fold(line) |
| 78 |
|
self.assertEqual(indention_depth, (1, INDENT.IndentType.FoldMarker, 1)) |
| 79 |
|
|
| 80 |
|
|
| 81 |
|
class TestCalcLineIndentionDepthFromSection(TestCase): |
|
@@ 23-49 (lines=27) @@
|
| 20 |
|
return INDENT.calc_line_indention_depth(line, INDENT.IndentType.Section, 1) |
| 21 |
|
|
| 22 |
|
|
| 23 |
|
class TestCalcLineIndentionDepthFromInitial(TestCase): |
| 24 |
|
""".""" |
| 25 |
|
|
| 26 |
|
def test_with_empty_line(self): |
| 27 |
|
line = "" |
| 28 |
|
indention_depth = indention_depth_from_initial(line) |
| 29 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.Initial, 0)) |
| 30 |
|
|
| 31 |
|
def test_with_comment(self): |
| 32 |
|
line = "; This is a comment" |
| 33 |
|
indention_depth = indention_depth_from_initial(line) |
| 34 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.Initial, 0)) |
| 35 |
|
|
| 36 |
|
def test_with_fold_marker(self): |
| 37 |
|
line = ";; This is a fold marker" |
| 38 |
|
indention_depth = indention_depth_from_initial(line) |
| 39 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.FoldMarker, 1)) |
| 40 |
|
|
| 41 |
|
def test_with_section(self): |
| 42 |
|
line = "[Section]" |
| 43 |
|
indention_depth = indention_depth_from_initial(line) |
| 44 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.Section, 1)) |
| 45 |
|
|
| 46 |
|
def test_with_key_value(self): |
| 47 |
|
line = "Key = Value" |
| 48 |
|
indention_depth = indention_depth_from_initial(line) |
| 49 |
|
self.assertEqual(indention_depth, (0, INDENT.IndentType.Initial, 0)) |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
class TestCalcLineIndentionDepthFromFoldMarker(TestCase): |