Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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