Files
codespell/codespell_lib/tests/test_basic.py
2016-04-27 10:18:36 -04:00

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)