コード例 #1
0
def test_ordered():
    target = {"a": [1, 3, 2], "c": "a", "b": 1}
    assert ordered(target) == [('a', [1, 2, 3]), ('b', 1), ('c', 'a')]
コード例 #2
0
ファイル: message.py プロジェクト: yxll/rasa_nlu
 def __hash__(self):
     return hash((self.text, str(ordered(self.data))))
コード例 #3
0
ファイル: message.py プロジェクト: yxll/rasa_nlu
 def __eq__(self, other):
     if not isinstance(other, Message):
         return False
     else:
         return ((other.text, ordered(other.data)) == (self.text,
                                                       ordered(self.data)))
コード例 #4
0
ファイル: message.py プロジェクト: githubclj/rasa_nlu
 def __hash__(self):
     return hash((self.text, str(ordered(self.data))))
コード例 #5
0
ファイル: message.py プロジェクト: githubclj/rasa_nlu
 def __eq__(self, other):
     if not isinstance(other, Message):
         return False
     else:
         return ((other.text, ordered(other.data)) ==
                 (self.text, ordered(self.data)))
コード例 #6
0
ファイル: test_utils.py プロジェクト: githubclj/rasa_nlu
def test_ordered():
    target = {"a": [1, 3, 2], "c": "a", "b": 1}
    assert ordered(target) == [('a', [1, 2, 3]), ('b', 1), ('c', 'a')]