Move get_head_sha into testing since it is only used by tests.

This commit is contained in:
Anthony Sottile 2014-04-14 09:57:38 -07:00
parent db6e1afc75
commit 94d626691f
5 changed files with 15 additions and 15 deletions

View file

@ -2,6 +2,7 @@ import jsonschema
import os
import os.path
import shutil
from plumbum import local
TESTING_DIR = os.path.abspath(os.path.dirname(__file__))
@ -29,6 +30,11 @@ def copy_tree_to_path(src_dir, dest_dir):
shutil.copy(srcname, destname)
def get_head_sha(dir):
with local.cwd(dir):
return local['git']['rev-parse', 'HEAD']().strip()
def is_valid_according_to_schema(obj, schema):
try:
jsonschema.validate(obj, schema)