<commit_before>import os
import posixpath, ntpath

from unittest import TestCase
import lektor_s3


class TestPosixPaths(TestCase):
    def setUp(self):
        self.old_path = os.path
        os.path = posixpath

    def tearDown(self):
        os.path = self.old_path

    def test_split_abspath(self):
        p = "/some/posixy/path"
        have = lektor_s3.split_path(p)
        self.assertEqual(have, ['/', 'some', 'posixy', 'path'])


    def test_split_abspath_trailing_slash(self):
        p = "/some/posixy/path/"
        have = lektor_s3.split_path(p)
        self.assertEqual(have, ['/', 'some', 'posixy', 'path', ''])

    def test_split_relpath(self):
        p = "some/posixy/path"
        have = lektor_s3.split_path(p)
        self.assertEqual(have, ['some', 'posixy', 'path'])<commit_msg>Add test case for empty path splitting<commit_after>import os
import posixpath, ntpath

from unittest import TestCase
import lektor_s3


class TestPosixPaths(TestCase):
    def setUp(self):
        self.old_path = os.path
        os.path = posixpath

    def tearDown(self):
        os.path = self.old_path

    def test_split_abspath(self):
        p = "/some/posixy/path"
        have = lektor_s3.split_path(p)
        self.assertEqual(have, ['/', 'some', 'posixy', 'path'])

    def test_split_empty_path(self):
        p = ""
        have = lektor_s3.split_path(p)
        self.assertEqual(have, [''])

    def test_split_abspath_trailing_slash(self):
        p = "/some/posixy/path/"
        have = lektor_s3.split_path(p)
        self.assertEqual(have, ['/', 'some', 'posixy', 'path', ''])

    def test_split_relpath(self):
        p = "some/posixy/path"
        have = lektor_s3.split_path(p)
        self.assertEqual(have, ['some', 'posixy', 'path'])
{'fraction_non_alphanumeric': 0.13824362606232293, 'fraction_numerical': 0.0050991501416430595, 'mean_word_length': 2.7815845824411136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5245085', 'n_tokens_mistral': 635, 'n_tokens_neox': 630, 'n_words': 117}