<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function

import unittest

from compare_with_remote.compare_with_remote import DirectoryURL, string_to_save_file_name


class MyTestCase(unittest.TestCase):
    def test_directory_url_parsing(self):
        self.assertEqual({'user_at_host': None, 'directory': 'foo'}, DirectoryURL.parse_url('foo'))
        self.assertEqual({'directory': '', 'user_at_host': 'foo'}, DirectoryURL.parse_url('foo:'))
        self.assertEqual({'directory': '', 'user_at_host': 'user@foo'}, DirectoryURL.parse_url('user@foo:'))
        self.assertEqual({'directory': '', 'user_at_host': 'user@foo'}, DirectoryURL.parse_url('user@foo'))
        self.assertEqual({'directory': 'mydir', 'user_at_host': 'user@foo'},
                         DirectoryURL.parse_url('user@foo:mydir'))
        self.assertEqual({'directory': '/mydir', 'user_at_host': 'user@foo'},
                         DirectoryURL.parse_url('user@foo:/mydir'))

    def test_user_at_host_or_none(self):
        self.assertEqual('user@foo', DirectoryURL('user@foo:mydir').user_at_host_or_none)

    def test_directory(self):
        self.assertEqual('mydir', DirectoryURL('user@foo:mydir').directory)
        self.assertEqual('', DirectoryURL('user@foo').directory)

    def test_string_to_save_file_name(self):
        self.assertEqual('x@:_______x', string_to_save_file_name('x@:ä  .. /x'))<commit_msg>next change to trigger ci.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function

import unittest

from compare_with_remote.compare_with_remote import DirectoryURL, string_to_save_file_name


class MyTestCase(unittest.TestCase):
    def test_directory_url_parsing(self):
        self.assertEqual({'user_at_host': None, 'directory': 'foo'}, DirectoryURL.parse_url('foo'))
        self.assertEqual({'directory': '', 'user_at_host': 'foo'}, DirectoryURL.parse_url('foo:'))
        self.assertEqual({'directory': '', 'user_at_host': 'user@foo'}, DirectoryURL.parse_url('user@foo:'))
        self.assertEqual({'directory': '', 'user_at_host': 'user@foo'}, DirectoryURL.parse_url('user@foo'))
        self.assertEqual({'directory': 'mydir', 'user_at_host': 'user@foo'},
                         DirectoryURL.parse_url('user@foo:mydir'))
        self.assertEqual({'directory': '/mydir', 'user_at_host': 'user@foo'},
                         DirectoryURL.parse_url('user@foo:/mydir'))

    def test_directory(self):
        self.assertEqual('mydir', DirectoryURL('user@foo:mydir').directory)
        self.assertEqual('', DirectoryURL('user@foo').directory)

    def test_user_at_host_or_none(self):
        self.assertEqual('user@foo', DirectoryURL('user@foo:mydir').user_at_host_or_none)


    def test_string_to_save_file_name(self):
        self.assertEqual('x@:_______x', string_to_save_file_name('x@:ä  .. /x'))
{'fraction_non_alphanumeric': 0.15916837082481256, 'fraction_numerical': 0.0006816632583503749, 'mean_word_length': 4.721247563352827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1081938', 'n_tokens_mistral': 930, 'n_tokens_neox': 890, 'n_words': 129}