Beispiel #1
0
    def test_67_split_force(self):
        """Split 'a b c' into 2 parts.

        Case: sep=None, maxsplit=1, default=None.
        """
        self.assertEqual(formatting.split_force('a b c', maxsplit=1),
                         ['a', 'b c'])
Beispiel #2
0
    def test_68_split_force(self):
        """Split 'a b c' into 4 parts.

        Case: sep=None, maxsplit=3, default=None.
        """
        self.assertEqual(formatting.split_force('a b c', maxsplit=3),
                         ['a', 'b', 'c', None])
Beispiel #3
0
    def test_70_split_force(self):
        """Split 'a b c d' into 1 part.

        Case: sep=' ', maxsplit=0, default=''.
        """
        self.assertEqual(
            formatting.split_force('a b c d', sep=' ', maxsplit=0, default=''),
            ['a b c d'])
Beispiel #4
0
    def test_69_split_force(self):
        """Split 'abc' into 4 parts.

        Case: sep=' ', maxsplit=3, default=''.
        """
        self.assertEqual(
            formatting.split_force('abc', sep=' ', maxsplit=3, default=''),
            ['abc', '', '', ''])
Beispiel #5
0
    def test_66_split_force(self):
        """Split 'a b c' into 3 parts.

        Case: sep=None, maxsplit=-1, defaults not used.
        """
        self.assertEqual(formatting.split_force('a b c'), ['a', 'b', 'c'])