Commits

Branko Vukelic  committed 9206412

Alias format kwarg as fmt since format is builtin

  • Participants
  • Parent commits aa07ec4

Comments (0)

Files changed (2)

File mstranslator/client.py

             kwargs['from'] = kwargs['tfrom']
             del kwargs['tfrom']
 
+        if 'fmt' in kwargs:
+            kwargs['format'] = kwargs['fmt']
+            del kwargs['fmt']
+
         url_params = dict()
 
         for k, v in kwargs.items():

File tests/test_client.py

             'from=test'
         )
 
+    def test_tformat_is_alias_for_format(self):
+        self.assertEqual(
+            self.t._get_quoted_data(fmt='test'),
+            'format=test'
+        )
+
     def test_get_full_url(self):
         self.assertEqual(
             self.t._get_full_url('Translate', text='foo'),