mirror of
https://github.com/codespell-project/codespell.git
synced 2025-05-22 01:46:09 +08:00
18 lines
452 B
Python
18 lines
452 B
Python
import tempfile
|
|
|
|
from nose.tools import assert_equal
|
|
|
|
from codespell_lib import main
|
|
|
|
|
|
def test_basic():
|
|
"""Test some basic functionality"""
|
|
assert_equal(main('_does_not_exist_'), 0)
|
|
with tempfile.NamedTemporaryFile() as f:
|
|
f.write('this is a test file\n'.encode('utf-8'))
|
|
f.flush()
|
|
assert_equal(main(f.name,), 0)
|
|
f.write('abandonned'.encode('utf-8'))
|
|
f.flush()
|
|
assert_equal(main(f.name), 1)
|