@@ -65,6 +65,34 @@ def test_list_format_strings_from_aliases_with_display(self, mock):
6565 self .assertEqual (result [2 ][0 ], "How do I feel? I feel... {{status}}!" )
6666 self .assertEqual (result [2 ][1 ], "How do I feel? I feel... {{status}}!" )
6767
68+ def test_list_format_strings_from_aliases_with_display_only (self , mock ):
69+ ALIASES = [
70+ MemoryActionAliasDB (name = 'andy' , ref = 'the_goonies.1' , formats = [
71+ {'display' : 'Watch this.' }]),
72+ MemoryActionAliasDB (name = 'andy' , ref = 'the_goonies.2' , formats = [
73+ {'display' : "He's just like his {{relation}}." }])
74+ ]
75+ result = matching .list_format_strings_from_aliases (ALIASES )
76+ self .assertEqual (len (result ), 2 )
77+ self .assertEqual (result [0 ][0 ], 'Watch this.' )
78+ self .assertEqual (result [0 ][1 ], [])
79+ self .assertEqual (result [1 ][0 ], "He's just like his {{relation}}." )
80+ self .assertEqual (result [1 ][1 ], [])
81+
82+ def test_list_format_strings_from_aliases_with_representation_only (self , mock ):
83+ ALIASES = [
84+ MemoryActionAliasDB (name = 'data' , ref = 'the_goonies.1' , formats = [
85+ {'representation' : "That's okay daddy. You can't hug a {{object}}." }]),
86+ MemoryActionAliasDB (name = 'mr_wang' , ref = 'the_goonies.2' , formats = [
87+ {'representation' : 'You are my greatest invention.' }])
88+ ]
89+ result = matching .list_format_strings_from_aliases (ALIASES )
90+ self .assertEqual (len (result ), 2 )
91+ self .assertEqual (result [0 ][0 ], None )
92+ self .assertEqual (result [0 ][1 ], "That's okay daddy. You can't hug a {{object}}." )
93+ self .assertEqual (result [1 ][0 ], None )
94+ self .assertEqual (result [1 ][1 ], 'You are my greatest invention.' )
95+
6896 def test_normalise_alias_format_string (self , mock ):
6997 result = matching .normalise_alias_format_string (
7098 'Quite an experience to live in fear, isn\' t it?' )
0 commit comments