forked from beloglazov/openstack-neat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscent.py
28 lines (24 loc) · 994 Bytes
/
scent.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from sniffer.api import *
from subprocess import call
import os
# This gets invoked on every file that gets changed in the directory. Return
# True to invoke any runnable functions, False otherwise.
#
# This fires runnables only if files ending with .py extension and not prefixed
# with a period.
@file_validator
def py_files(filename):
return filename.endswith('.py') and \
not filename.endswith('flymake.py') and \
not os.path.basename(filename).startswith('.')
# This gets invoked for verification. This is ideal for running tests of some sort.
# For anything you want to get constantly reloaded, do an import in the function.
#
# sys.argv[0] and any arguments passed via -x prefix will be sent to this function as
# it's arguments. The function should return logically True if the validation passed
# and logicially False if it fails.
#
# This example simply runs nose.
@runnable
def execute_tests(*args):
return not call(['python2', 'setup.py', '-q', 'test'])