def test_namespace_registration(): Model.register_namespace('scap.model.derp', 'http://jaymes.biz/derp') Model.xmlns_to_package('http://jaymes.biz/derp') == 'scap.model.derp' Model.unregister_namespace('scap.model.derp') with pytest.raises(UnregisteredNamespaceException): Model.xmlns_to_package('http://jaymes.biz/derp')
def test_xmlns_to_package(): assert Model.xmlns_to_package('http://jaymes.biz/test') == 'fixtures.test' assert Model.xmlns_to_package('http://jaymes.biz/test2') == 'fixtures.test2' with pytest.raises(UnregisteredNamespaceException): Model.xmlns_to_package('http://jaymes.biz/derp')