File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1+ requests == 2.32.5
12requests-mock == 1.8.0
23PyYAML == 6.0.1
34expandvars == 0.6.5
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2020 Foundries.io
2+ # SPDX-License-Identifier: BSD-3-Clause
3+
4+ import os
5+ import sys
6+ import unittest
7+
8+ import requests
9+ import yaml
10+
11+
12+ class JobservSchemaTest (unittest .TestCase ):
13+ def test_schema (self ):
14+ here = os .path .abspath (__file__ )
15+ root = os .path .dirname (os .path .dirname (here ))
16+
17+ paths = ("lmp/jobserv.yml" , "factory-containers/jobserv.yml" )
18+ for p in paths :
19+ with open (os .path .join (root , p )) as f :
20+ data = yaml .safe_load (f )
21+ r = requests .post ("https://api.foundries.io/simulator-validate" , json = data )
22+ if r .status_code != 200 :
23+ try :
24+ sys .exit (r .json ()['message' ])
25+ except Exception :
26+ sys .exit (r .text )
Original file line number Diff line number Diff line change 1- #! /bin/sh -e
1+ #! /bin/bash -e
22
33VENV_DIR=$( mktemp -d -p $PWD )
44python3 -m venv " ${VENV_DIR} "
You can’t perform that action at this time.
0 commit comments