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=''", )
def test_one_positional_argument(self): self.assertEqual(format_arguments(1), "1") self.assertEqual(format_arguments(None), "None") self.assertEqual(format_arguments("hello"), "'hello'")
def test_multiple_positional_arguments(self): self.assertEqual(format_arguments(1, 2), "1, 2") self.assertEqual( format_arguments(" ", ["apple", "banana"]), "' ', ['apple', 'banana']", )
def test_multiple_keyword_arguments(self): self.assertEqual( format_arguments(file="log", mode="wt"), "file='log', mode='wt'", )
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'")