示例#1
0
 def _ensure_schema_out(self, data):
     if data is not None and isinstance(data, dict):
         if arr_eq(data.keys(), self.schema_out.keys()):
             return data
     raise SchemaException(
         message='data %r does not conform to output schema' % data)
示例#2
0
def test_arr_eq_equal():
    a = [1, 2, 3]
    b = [1, 2, 3]
    ok = utils.arr_eq(a, b)
    assert ok
示例#3
0
def test_arr_eq_one_empty():
    a = [1, 2, 3]
    b = []
    ok = utils.arr_eq(a, b)
    assert not ok
示例#4
0
def test_arr_eq_not_equal():
    a = [1, 2, 3]
    b = [1, 2, 4]
    ok = utils.arr_eq(a, b)
    assert not ok
示例#5
0
def test_arr_eq_empty_arrays():
    a = []
    b = []
    ok = utils.arr_eq(a, b)
    assert not ok