Exemple #1
0
def test_SchemaRegistry():
    r"""Test schema registry."""
    with pytest.raises(ValueError):
        schema.SchemaRegistry({})
    x = schema.SchemaRegistry()
    assert ((x == 0) is False)
    fname = os.path.join(tempfile.gettempdir(), 'temp.yml')
    with open(fname, 'w') as fd:
        fd.write('')
    with pytest.raises(Exception):
        x.load(fname)
    os.remove(fname)
Exemple #2
0
def test_SchemaRegistry():
    r"""Test schema registry."""
    assert_raises(ValueError, schema.SchemaRegistry, {})
    x = schema.SchemaRegistry()
    assert_equal(x == 0, False)
    fname = os.path.join(tempfile.gettempdir(), 'temp.yml')
    with open(fname, 'w') as fd:
        fd.write('')
    assert_raises(Exception, x.load, fname)
    os.remove(fname)