return r.json()
def remove_aspect(self, aspect_id):
- """ This function adds a new aspect.
+ """ This function removes an aspect.
"""
- data = {'authenticity_token': self.connection.get_token()}
-
- r = self.connection.delete('aspects/{}'.format(aspect_id),
- data=data)
-
- if r.status_code != 404:
- raise Exception('wrong status code: {0}'.format(r.status_code))
+ aspects = diaspy.streams.Aspects(self.connection)
+ aspects.remove(aspect_id)
def new_conversation(self, contacts, subject, text):
"""Start a new conversation.
if r.status_code != 200:
raise Exception('wrong status code: {0}'.format(r.status_code))
+ def remove(self, aspect_id):
+ """This method removes an aspect.
+ """
+ data = {'authenticity_token': self.connection.get_token()}
+ r = self.connection.delete('aspects/{}'.format(aspect_id),
+ data=data)
+ if r.status_code != 404:
+ raise Exception('wrong status code: {0}'.format(r.status_code))
+
class Commented(Generic):
"""This stream contains all posts
def _setlocation(self):
self._location = 'followed_tags.json'
- def create(self, tag_name):
+ def remove(self, tag_name):
+ """Stop following a tag.
+
+ :param tag_name: tag name
+ :type tag_name: str
+ """
+ data = {}
+ headers = {}
+ request = None
+
+ def add(self, tag_name):
"""Follow new tag.
:param tag_name: tag name
stream = diaspy.streams.Stream(test_connection)
stream.post_picture('./test-image.png')
+ def testCreatingTag(self):
+ ft = diaspy.streams.FollowedTags(test_connection)
+ ft.create('test')
+
class ConnectionTest(unittest.TestCase):
def testLoginWithoutUsername(self):