306:edefddec933d
Anton Shestakov <av6@dwimlabs.net>, Sun, 24 Sep 2017 12:25:05 +0800
viewer: use subqueries to get data on index page Before, there were bare columns in the aggregate query, their values were undefined (but it somehow worked), as SQLite docs say. Good news is that now this bigger query uses (project_id, ordinal) index and is really fast.

next change 354:23e5b4d4f272
previous change 130:7a9e1f1ae89f

tests/test_checker.py

Permissions: -rw-r--r--

Other formats: Feeds:
from checker import run, read_linter_config, prevalidate
def test_run():
result = run(['true'])
assert result is True
result = run(['false'])
assert result is False
result = run(['false'], ignore_codes=(1,))
assert result is True
result = run(['false'], ignore_codes=(127,))
assert result is False
result = run(['echo', 'hi'], get_output=False)
assert result is True
result = run(['echo', 'hi'], get_output=True)
assert result == 'hi\n'
def test_read_linter_config():
config = read_linter_config('flake8')
assert config is not None
assert 'exec' in config
assert 'setup' in config
assert len(config['setup']) > 0
config = read_linter_config('perfectlinter')
assert config is None
def test_prevalidate():
assert not prevalidate({})
config = {'scm': 'fossil', 'url': 'http://www.fossil-scm.org/'}
assert not prevalidate(config)
config = {'scm': 'hg', 'url': 'https://selenic.com/hg'}
assert prevalidate(config)