Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
X
xivo-dao
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xivo.solutions
xivo-dao
Commits
51ecfd91
Commit
51ecfd91
authored
Aug 05, 2020
by
Rim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3392 add update labels APi
parent
cb12deab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
debian/changelog
debian/changelog
+6
-0
xivo_dao/resources/labels/dao.py
xivo_dao/resources/labels/dao.py
+6
-0
xivo_dao/resources/labels/tests/test_dao.py
xivo_dao/resources/labels/tests/test_dao.py
+12
-0
No files found.
debian/changelog
View file @
51ecfd91
xivo-dao (2020.14.00) xivo-freya; urgency=medium
* 3392 update labels API
-- Rim Jamali <rjamali@xivo.solutions> Wed, 05 Aug 2020 10:36:53 +0200
xivo-dao (2020.13.00) xivo-freya; urgency=medium
* 3389 Create labels api
...
...
xivo_dao/resources/labels/dao.py
View file @
51ecfd91
...
...
@@ -48,6 +48,12 @@ def create(label):
return
label
def
edit
(
label
):
Session
.
add
(
label
)
Session
.
flush
()
return
label
def
delete
(
label
):
Session
.
delete
(
label
)
Session
.
flush
()
...
...
xivo_dao/resources/labels/tests/test_dao.py
View file @
51ecfd91
...
...
@@ -38,6 +38,8 @@ class TestLabelExist(DAOTestCase):
assert_that
(
result
,
equal_to
(
True
))
class
TestLabelCRUD
(
DAOTestCase
):
def
test_get_all_labels
(
self
):
self
.
add_user
(
callerid
=
'"John Doe"'
)
...
...
@@ -88,3 +90,13 @@ class TestLabelExist(DAOTestCase):
result
=
label_dao
.
search
()
assert_that
(
result
,
equal_to
(
expected
))
def
test_edit_label
(
self
):
label
=
self
.
add_label
()
label
.
display_name
=
'MyLabel'
label
.
description
=
'Any Label'
label_dao
.
edit
(
label
)
result
=
label_dao
.
get
(
label
.
id
)
assert_that
(
result
,
equal_to
(
label
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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