Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
raise notimplemented added
Browse files Browse the repository at this point in the history
  • Loading branch information
zalun committed Oct 8, 2012
1 parent fdf4759 commit 7dfddb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion marketplace/client.py
Expand Up @@ -169,7 +169,8 @@ def delete(self, app_id):
"""Delete an app from Marketplace
"""
# XXX: This isn't yet implemented on API
return self.conn.fetch('DELETE', self.url('app') % app_id)
# return self.conn.fetch('DELETE', self.url('app') % app_id)
raise NotImplementedError()

def create_screenshot(self, app_id, filename, mimetype='image/jpg',
position=1):
Expand Down
7 changes: 6 additions & 1 deletion marketplace/tests/testClient.py
Expand Up @@ -5,6 +5,7 @@
import json
import logging
import os
import unittest

from base64 import b64encode

Expand Down Expand Up @@ -34,7 +35,7 @@ def __init__(self, status_code, content=None):
self.status_code = status_code
self.content = content

class TestClient(object):
class TestClient(unittest.TestCase):

def setUp(self):
self.marketplace = marketplace.Client(
Expand Down Expand Up @@ -176,11 +177,15 @@ def test_status(self):
eq_(content['manifest'], '0a650e5e4c434b5cb60c5495c0d88a89')

def test_delete(self):
raise SkipTest()
requests.delete = Mock(return_value=Response(204, ''))
response = self.marketplace.delete(1)
eq_(response.status_code, 204)
assert not response.content

def test_delete_not_implemented(self):
self.assertRaises(NotImplementedError, self.marketplace.delete, 1)

def test_add_screenshot(self):
path = lambda *a: os.path.join(
os.path.dirname(os.path.abspath(__file__)), *a)
Expand Down

0 comments on commit 7dfddb0

Please sign in to comment.