コード例 #1
0
ファイル: python_test.py プロジェクト: isa/pyformatter
   def test_dump_should_indent_with_three_spaces(self):
      three_space = "   "
      lines = ['def method():', ' a_statement']
      expected_number_of_indentation = 1
      python_printer = PythonPrinter(lines)

      actual = python_printer.dump()
      self.assertTrue(actual.count(three_space) is expected_number_of_indentation)
コード例 #2
0
    def test_dump_should_indent_with_three_spaces(self):
        three_space = "   "
        lines = ['def method():', ' a_statement']
        expected_number_of_indentation = 1
        python_printer = PythonPrinter(lines)

        actual = python_printer.dump()
        self.assertTrue(
            actual.count(three_space) is expected_number_of_indentation)
コード例 #3
0
ファイル: python_test.py プロジェクト: isa/pyformatter
   def test_dump_should_indent_with_four_spaces(self):
      four_space = "   "
      lines = ['def method():', ' a_statement']
      expected_number_of_indentation = 1
      options = { 'indent': 4 }
      python_printer = PythonPrinter(lines, options)

      actual = python_printer.dump()
      self.assertTrue(actual.count(four_space) is expected_number_of_indentation)
コード例 #4
0
    def test_dump_should_indent_with_four_spaces(self):
        four_space = "   "
        lines = ['def method():', ' a_statement']
        expected_number_of_indentation = 1
        options = {'indent': 4}
        python_printer = PythonPrinter(lines, options)

        actual = python_printer.dump()
        self.assertTrue(
            actual.count(four_space) is expected_number_of_indentation)