Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranmccormick committed Aug 22, 2020
2 parents f1111c0 + f7afd46 commit 321d59b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
#########

-----
0.7.0
-----

- Fixed bug releating to scheduling messages with media attached.

-----
0.6.6
-----
Expand Down
2 changes: 1 addition & 1 deletion hootsweet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from hootsweet.api import HootSweet

__version__ = "0.6.6"
__version__ = "0.7.0"

__all__ = ["HootSweet"]
5 changes: 2 additions & 3 deletions hootsweet/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def get_member_organizations(self, member_id: str) -> List[Dict[str, Any]]:
return self._make_request(resource)

def schedule_message(
self, text: str, social_profile_ids: List[str], send_time: datetime, **kwargs
self, text: str, social_profile_ids: List[str], send_time: datetime, **kwargs,
):
"""Schedule a message to send on one or more social profiles.
Expand All @@ -280,8 +280,7 @@ def schedule_message(
"emailNotification": False,
}
data.update(kwargs)
json_ = json.dumps(data)
return self._make_request(resource, method="POST", data=json_)
return self._make_request(resource, method="POST", json=data)

def get_outbound_messages(
self,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hootsweet"
version = "0.6.6"
version = "0.7.0"
description = "A python library for the HootSuite REST API."
authors = ["Ciaran McCormick <ciaran@ciaranmccormick.com>"]
readme = "README.rst"
Expand Down
16 changes: 7 additions & 9 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,15 @@ def test_schedule_message(mock_session):
ids_ = ["1234", "12345"]
send_time = datetime.datetime(2020, 1, 1, 13, 10, 14)
hoot_suite.schedule_message(text, ids_, send_time=send_time)
expected_json = json.dumps(
{
"text": text,
"socialProfileIds": ids_,
"scheduledSendTime": send_time.strftime(ISO_FORMAT),
"emailNotification": False,
}
)
data = {
"text": text,
"socialProfileIds": ids_,
"scheduledSendTime": send_time.strftime(ISO_FORMAT),
"emailNotification": False,
}
expected_url = "https://platform.hootsuite.com/v1/messages"
mock_session.return_value.request.assert_called_once_with(
"POST", expected_url, data=expected_json
"POST", expected_url, json=data
)


Expand Down

0 comments on commit 321d59b

Please sign in to comment.