Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Added delete group and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudi Giesler committed Aug 21, 2014
1 parent a2454d6 commit c2e9235
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions go_http/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,12 @@ def update_group(self, group_key, update_data):
Fields to modify.
"""
return self._api_request("PUT", "groups", group_key, update_data)

def delete_group(self, group_key):
"""
Delete a group.
:param str group_key
Key for the group to delete.
"""
return self._api_request("DELETE", "groups", group_key)
15 changes: 15 additions & 0 deletions go_http/tests/test_contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,18 @@ def test_update_smart_group(self):
def test_update_missing_group(self):
client = self.make_client()
self.assert_http_error(404, client.update_group, 'foo', {})

def test_delete_group(self):
client = self.make_client()
existing_group = self.make_existing_group({
u'name': u'Bob'
})

self.assert_group_status(existing_group[u'key'], exists=True)
group = client.delete_group(existing_group[u'key'])
self.assertEqual(existing_group, group)
self.assert_group_status(group[u'key'], exists=False)

def test_delete_missing_group(self):
client = self.make_client()
self.assert_http_error(404, client.delete_group, 'foo')

0 comments on commit c2e9235

Please sign in to comment.