Пример #1
0
 def test_passing_case(self):
     lines = [
         "def method1(self):",
         "    # amend method 1",
         "    return 2",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
     ]
     check_indentation(lines, future_lines)  # should not raise
Пример #2
0
 def test_passing_case(self):
     lines = [
         "def method1(self):",
         "    # amend method 1",
         "    return 2",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
     ]
     check_indentation(lines, future_lines) # should not raise
Пример #3
0
 def test_blank_lines_in_listing_are_ignored(self):
     lines = [
         "def method1(self):",
         "    # amend method 1",
         "    return 2",
         "",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
     ]
     check_indentation(lines, future_lines)  # should not raise
Пример #4
0
 def test_under_indentation_differences_are_picked_up(self):
     lines = [
         "def method1(self):",
         "# amend method 1",
         "    return 2",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
     ]
     with self.assertRaises(ApplyCommitException):
         check_indentation(lines, future_lines)
Пример #5
0
 def test_blank_lines_in_listing_are_ignored(self):
     lines = [
         "def method1(self):",
         "    # amend method 1",
         "    return 2",
         "",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
     ]
     check_indentation(lines, future_lines) # should not raise
Пример #6
0
 def test_under_indentation_differences_are_picked_up(self):
     lines = [
         "def method1(self):",
         "# amend method 1",
         "    return 2",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
     ]
     with self.assertRaises(ApplyCommitException):
         check_indentation(lines, future_lines)
Пример #7
0
 def test_elipsis_lines_are_ignored(self):
     lines = [
         "def method1(self):",
         "    # amend method 1",
         "    return 2",
         "[...]",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
         "stuff",
     ]
     check_indentation(lines, future_lines)  # should not raise
Пример #8
0
 def test_elipsis_lines_are_ignored(self):
     lines = [
         "def method1(self):",
         "    # amend method 1",
         "    return 2",
         "[...]",
     ]
     future_lines = [
         "    def method1(self):",
         "        # amend method 1",
         "        return 2",
         "stuff",
     ]
     check_indentation(lines, future_lines) # should not raise