Example #1
0
def test_reponse_check_for_inception():
    '''
    Given a dict with a dict, it should convert all the dicts to ResponseObject
  '''

    awesome_dict = {'key': 'value', 'second_dict': {'key2': 'value2'}}

    response = ResponseObject(awesome_dict)
    response.key3 = 'value3'

    eq_(response.key, 'value')
    eq_(response.key3, 'value3')
    eq_(response.second_dict, {'key2': 'value2'})
    eq_(response.second_dict.key2, 'value2')
Example #2
0
def test_reponse_check_for_inception():
    """
    Given a dict with a dict, it should convert all the dicts to ResponseObject
    """

    awesome_dict = {"key": "value", "second_dict": {"key2": "value2"}}

    response = ResponseObject(awesome_dict)
    response.key3 = "value3"

    assert response.key == "value"
    assert response.key3 == "value3"
    assert response.second_dict["key2"] == "value2"
    assert response.second_dict.key2 == "value2"
Example #3
0
def test_reponse_check_for_inception():
  '''
    Given a dict with a dict, it should convert all the dicts to ResponseObject
  '''

  awesome_dict = {
    'key': 'value',
    'second_dict': {
      'key2': 'value2'
    }
  }

  response = ResponseObject(awesome_dict)
  response.key3 = 'value3'

  eq_(response.key, 'value')
  eq_(response.key3, 'value3')
  eq_(response.second_dict, {'key2': 'value2'})
  eq_(response.second_dict.key2, 'value2')
Example #4
0
    def info(self):
        '''
      Returns an object with the current configuration that Buffer is using,
      including supported services, their icons and the varying limits of
      character and schedules.

      The services keys map directly to those on profiles and updates so that
      you can easily show the correct icon or calculate the correct character
      length for an update.
    '''

        response = self.get(url=PATHS['INFO'])
        return ResponseObject(response)
Example #5
0
  def interactions(self):
    '''
      Returns the detailed information on individual interactions with the social
      media update such as favorites, retweets and likes.
    '''

    interactions = []
    url = PATHS['GET_INTERACTIONS'] % self.id

    response = self.api.get(url=url)
    for interaction in response['interactions']:
      interactions.append(ResponseObject(interaction))

    self.__interactions = interactions

    return self.__interactions