예제 #1
0
 def message(self) -> str:
     return (
         "When {given} {_is} specified, {missing} must be specified as well"
     ).format(
         given=format_list(
             transform(self._obj.mocked_files,
                       _file_role_to_option_translation)),
         _is=format_plural(self._obj.mocked_files, "is"),
         missing=format_list(
             transform(self._obj.required_files,
                       _file_role_to_option_translation)),
     )
예제 #2
0
 def message(self) -> str:
     return "This command does not support {forbidden_options}".format(
         forbidden_options=format_list(
             transform(
                 self._obj.forbidden_options,
                 _file_role_to_option_translation,
             )), )
예제 #3
0
 def test_transform(self):
     self.assertEqual(
         tools.transform(
             ["A", "0", "C", "x", "A", "B", "a"], {"A": "a", "C": "1"}
         ),
         ["a", "0", "1", "x", "a", "B", "a"],
     )