예제 #1
0
파일: test_trim.py 프로젝트: myint/trim
    def test_is_text_should_consider_empty_files_as_non_text(self):
        import tempfile
        with tempfile.NamedTemporaryFile(mode='w') as temporary_file:
            temporary_file.write('')
            temporary_file.flush()

            self.assertFalse(trim.is_text(temporary_file.name))
예제 #2
0
파일: test_trim.py 프로젝트: myint/trim
    def test_is_text_should_consider_empty_files_as_non_text(self):
        import tempfile
        with tempfile.NamedTemporaryFile(mode='w') as temporary_file:
            temporary_file.write('')
            temporary_file.flush()

            self.assertFalse(trim.is_text(temporary_file.name))
예제 #3
0
파일: test_trim.py 프로젝트: myint/trim
    def test_is_text_should_consider_whitespace_only_as_text(self):
        import tempfile
        with tempfile.NamedTemporaryFile(mode='w') as temporary_file:
            temporary_file.write('     ')
            temporary_file.flush()

            self.assertTrue(trim.is_text(temporary_file.name))
예제 #4
0
파일: test_trim.py 프로젝트: myint/trim
    def test_is_text_should_consider_whitespace_only_as_text(self):
        import tempfile
        with tempfile.NamedTemporaryFile(mode='w') as temporary_file:
            temporary_file.write('     ')
            temporary_file.flush()

            self.assertTrue(trim.is_text(temporary_file.name))
예제 #5
0
파일: test_trim.py 프로젝트: myint/trim
    def test_is_text(self):
        self.assertTrue(trim.is_text(os.path.join(ROOT_DIR, 'README.rst')))
        self.assertTrue(trim.is_text(os.path.join(ROOT_DIR, 'trim')))

        self.assertFalse(trim.is_text(sys.executable))
        self.assertFalse(trim.is_text('/bin/bash'))
        self.assertFalse(trim.is_text('/usr/bin/env'))
        self.assertFalse(trim.is_text('non_existent_file'))
예제 #6
0
파일: test_trim.py 프로젝트: myint/trim
    def test_is_text(self):
        self.assertTrue(trim.is_text(os.path.join(ROOT_DIR, 'README.rst')))
        self.assertTrue(trim.is_text(os.path.join(ROOT_DIR, 'trim')))

        self.assertFalse(trim.is_text(sys.executable))
        self.assertFalse(trim.is_text('/bin/bash'))
        self.assertFalse(trim.is_text('/usr/bin/env'))
        self.assertFalse(trim.is_text('non_existent_file'))
예제 #7
0
파일: test_trim.py 프로젝트: myint/trim
 def test_is_text_should_consider_symlinks_as_non_text(self):
     self.assertFalse(trim.is_text(os.path.join(ROOT_DIR, 'trim.py')))
예제 #8
0
파일: test_trim.py 프로젝트: myint/trim
 def test_is_text_should_consider_symlinks_as_non_text(self):
     self.assertFalse(trim.is_text(os.path.join(ROOT_DIR, 'trim.py')))