Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Turris
pyuci
Commits
700c6cf0
Verified
Commit
700c6cf0
authored
Mar 15, 2018
by
Karel Koci
🤘
Browse files
Fix name of uci.ExceptionNotFound in module
parent
786f2bbc
Pipeline
#34401
passed with stage
in 17 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
pyuci.c
View file @
700c6cf0
...
...
@@ -488,7 +488,7 @@ bool pyuci_object_init(PyObject *module) {
UciExcNotFound
=
PyErr_NewException
(
"uci.UciExceptionNotFound"
,
UciException
,
NULL
);
Py_INCREF
(
UciExcNotFound
);
PyModule_AddObject
(
module
,
"UciExcNotFound"
,
UciExcNotFound
);
PyModule_AddObject
(
module
,
"UciExc
eption
NotFound"
,
UciExcNotFound
);
return
true
;
}
tests/test_module.py
View file @
700c6cf0
...
...
@@ -79,12 +79,12 @@ config testing 'testing'
u
=
uci
.
Uci
(
confdir
=
tmpdir
.
strpath
)
u
.
delete
(
'test'
,
'testing'
,
'one'
)
assert
u
.
get
(
'test'
,
'testing'
,
'two'
)
==
'1'
with
pytest
.
raises
(
uci
.
UciExcNotFound
):
with
pytest
.
raises
(
uci
.
UciExc
eption
NotFound
):
u
.
get
(
'test'
,
'testing'
,
'one'
)
u
.
delete
(
'test'
,
'testing'
)
with
pytest
.
raises
(
uci
.
UciExcNotFound
):
with
pytest
.
raises
(
uci
.
UciExc
eption
NotFound
):
u
.
get
(
'test'
,
'testing'
,
'two'
)
with
pytest
.
raises
(
uci
.
UciExcNotFound
):
with
pytest
.
raises
(
uci
.
UciExc
eption
NotFound
):
u
.
get
(
'test'
,
'testing'
)
...
...
@@ -97,13 +97,13 @@ config testing 'testing'
"""
)
u
=
uci
.
Uci
(
confdir
=
tmpdir
.
strpath
)
u
.
rename
(
'test'
,
'testing'
,
'one'
,
'three'
)
with
pytest
.
raises
(
uci
.
UciExcNotFound
):
with
pytest
.
raises
(
uci
.
UciExc
eption
NotFound
):
u
.
get
(
'test'
,
'testing'
,
'one'
)
assert
u
.
get
(
'test'
,
'testing'
,
'three'
)
==
'0'
u
.
rename
(
'test'
,
'testing'
,
'deploy'
)
with
pytest
.
raises
(
uci
.
UciExcNotFound
):
with
pytest
.
raises
(
uci
.
UciExc
eption
NotFound
):
u
.
get
(
'test'
,
'testing'
,
'three'
)
with
pytest
.
raises
(
uci
.
UciExcNotFound
):
with
pytest
.
raises
(
uci
.
UciExc
eption
NotFound
):
u
.
get
(
'test'
,
'testing'
,
'two'
)
assert
u
.
get
(
'test'
,
'deploy'
,
'three'
)
==
'0'
assert
u
.
get
(
'test'
,
'deploy'
,
'two'
)
==
'1'
...
...
@@ -155,7 +155,7 @@ def test_revert(tmpdir):
u
.
set
(
'test'
,
'testing'
,
'variable'
,
'value'
)
assert
u
.
get
(
'test'
,
'testing'
,
'variable'
)
==
'value'
u
.
revert
(
'test'
)
with
pytest
.
raises
(
uci
.
UciExcNotFound
):
with
pytest
.
raises
(
uci
.
UciExc
eption
NotFound
):
u
.
get
(
'test'
,
'testing'
,
'variable'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment