Commit 700c6cf0 authored by Karel Koci's avatar Karel Koci 🤘

Fix name of uci.ExceptionNotFound in module

parent 786f2bbc
Pipeline #34401 passed with stage
in 17 seconds
...@@ -488,7 +488,7 @@ bool pyuci_object_init(PyObject *module) { ...@@ -488,7 +488,7 @@ bool pyuci_object_init(PyObject *module) {
UciExcNotFound = PyErr_NewException("uci.UciExceptionNotFound", UciException, NULL); UciExcNotFound = PyErr_NewException("uci.UciExceptionNotFound", UciException, NULL);
Py_INCREF(UciExcNotFound); Py_INCREF(UciExcNotFound);
PyModule_AddObject(module, "UciExcNotFound", UciExcNotFound); PyModule_AddObject(module, "UciExceptionNotFound", UciExcNotFound);
return true; return true;
} }
...@@ -79,12 +79,12 @@ config testing 'testing' ...@@ -79,12 +79,12 @@ config testing 'testing'
u = uci.Uci(confdir=tmpdir.strpath) u = uci.Uci(confdir=tmpdir.strpath)
u.delete('test', 'testing', 'one') u.delete('test', 'testing', 'one')
assert u.get('test', 'testing', 'two') == '1' assert u.get('test', 'testing', 'two') == '1'
with pytest.raises(uci.UciExcNotFound): with pytest.raises(uci.UciExceptionNotFound):
u.get('test', 'testing', 'one') u.get('test', 'testing', 'one')
u.delete('test', 'testing') u.delete('test', 'testing')
with pytest.raises(uci.UciExcNotFound): with pytest.raises(uci.UciExceptionNotFound):
u.get('test', 'testing', 'two') u.get('test', 'testing', 'two')
with pytest.raises(uci.UciExcNotFound): with pytest.raises(uci.UciExceptionNotFound):
u.get('test', 'testing') u.get('test', 'testing')
...@@ -97,13 +97,13 @@ config testing 'testing' ...@@ -97,13 +97,13 @@ config testing 'testing'
""") """)
u = uci.Uci(confdir=tmpdir.strpath) u = uci.Uci(confdir=tmpdir.strpath)
u.rename('test', 'testing', 'one', 'three') u.rename('test', 'testing', 'one', 'three')
with pytest.raises(uci.UciExcNotFound): with pytest.raises(uci.UciExceptionNotFound):
u.get('test', 'testing', 'one') u.get('test', 'testing', 'one')
assert u.get('test', 'testing', 'three') == '0' assert u.get('test', 'testing', 'three') == '0'
u.rename('test', 'testing', 'deploy') u.rename('test', 'testing', 'deploy')
with pytest.raises(uci.UciExcNotFound): with pytest.raises(uci.UciExceptionNotFound):
u.get('test', 'testing', 'three') u.get('test', 'testing', 'three')
with pytest.raises(uci.UciExcNotFound): with pytest.raises(uci.UciExceptionNotFound):
u.get('test', 'testing', 'two') u.get('test', 'testing', 'two')
assert u.get('test', 'deploy', 'three') == '0' assert u.get('test', 'deploy', 'three') == '0'
assert u.get('test', 'deploy', 'two') == '1' assert u.get('test', 'deploy', 'two') == '1'
...@@ -155,7 +155,7 @@ def test_revert(tmpdir): ...@@ -155,7 +155,7 @@ def test_revert(tmpdir):
u.set('test', 'testing', 'variable', 'value') u.set('test', 'testing', 'variable', 'value')
assert u.get('test', 'testing', 'variable') == 'value' assert u.get('test', 'testing', 'variable') == 'value'
u.revert('test') u.revert('test')
with pytest.raises(uci.UciExcNotFound): with pytest.raises(uci.UciExceptionNotFound):
u.get('test', 'testing', 'variable') u.get('test', 'testing', 'variable')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment