Commit 51ecfd91 authored by Rim's avatar Rim

3392 add update labels APi

parent cb12deab
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
......
......@@ -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()
......
......@@ -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))
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