Skip to content

Commit

Permalink
Merge branch 'release/3.0.7' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
javipalanca committed Sep 27, 2018
2 parents 9399e4b + f9b464d commit 01e82ca
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
History
=======

3.0.7 (2018-09-27)
------------------

* Fixed bug when running FSM states.
* Improved Message __str__.
* Fixed bug when thread is not defined in a message.
* aioxmpp send method is now in client instead of stream.

3.0.6 (2018-09-27)
------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.0.6
current_version = 3.0.7
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def parse_requirements(filename):

setup(
name='spade',
version='3.0.6',
version='3.0.7',
description="Smart Python Agent Development Environment",
long_description=readme + '\n\n' + history,
author="Javi Palanca",
Expand Down
2 changes: 1 addition & 1 deletion spade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

__author__ = """Javi Palanca"""
__email__ = 'jpalanca@gmail.com'
__version__ = '3.0.6'
__version__ = '3.0.7'

__all__ = ["agent", "behaviour", "message", "template"]
26 changes: 26 additions & 0 deletions tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import copy

import aioxmpp
import aioxmpp.forms.xso as forms_xso
import pytest

from spade.message import Message, SPADE_X_METADATA
Expand Down Expand Up @@ -73,6 +74,31 @@ def test_body_with_languages():
assert new_msg.body == "Hello World"


def test_message_from_node():
aiomsg = aioxmpp.Message(type_=aioxmpp.MessageType.CHAT)
data = forms_xso.Data(type_=forms_xso.DataType.FORM)

data.fields.append(
forms_xso.Field(
var="performative",
type_=forms_xso.FieldType.TEXT_SINGLE,
values=["request"],
)
)

data.fields.append(forms_xso.Field(var="_thread_node",
type_=forms_xso.FieldType.TEXT_SINGLE,
values=["thread-id"]))
data.title = SPADE_X_METADATA
aiomsg.xep0004_data = [data]

msg = Message.from_node(aiomsg)

assert msg.thread == "thread-id"
assert msg.get_metadata("performative") == "request"
assert msg.metadata == {"performative": "request"}


def test_thread_empty():
msg = Message(thread=None)

Expand Down

0 comments on commit 01e82ca

Please sign in to comment.