예제 #1
0
 def test_mixed_arguments(self):
     self.assertEqual(
         format_arguments(["apple", "banana"], start=1),
         "['apple', 'banana'], start=1",
     )
     self.assertEqual(
         format_arguments("log", "wt", encoding="utf-8", newline=""),
         "'log', 'wt', encoding='utf-8', newline=''",
     )
예제 #2
0
 def test_one_positional_argument(self):
     self.assertEqual(format_arguments(1), "1")
     self.assertEqual(format_arguments(None), "None")
     self.assertEqual(format_arguments("hello"), "'hello'")
예제 #3
0
 def test_multiple_positional_arguments(self):
     self.assertEqual(format_arguments(1, 2), "1, 2")
     self.assertEqual(
         format_arguments(" ", ["apple", "banana"]),
         "' ', ['apple', 'banana']",
     )
예제 #4
0
 def test_multiple_keyword_arguments(self):
     self.assertEqual(
         format_arguments(file="log", mode="wt"),
         "file='log', mode='wt'",
     )
예제 #5
0
 def test_one_keyword_argument(self):
     self.assertEqual(format_arguments(n=1), "n=1")
     self.assertEqual(format_arguments(object=None), "object=None")
     self.assertEqual(format_arguments(name="Trey"), "name='Trey'")