Пример #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