Exemple #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
 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
Exemple #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
Exemple #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)
 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
 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)
Exemple #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
 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