<commit_before># -*- coding: iso-8859-1 -*-
# (c) 2009-2016 <NAME> and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
    Run litmus against WsgiDAV server.
"""
from __future__ import print_function

# from multiprocessing.process import Process
from multiprocessing import Process
import os
import subprocess
import sys
from tempfile import gettempdir
import time
import unittest

from tests.util import WsgiDavTestServer
from wsgidav.wsgidav_app import DEFAULT_CONFIG, WsgiDAVApp
from wsgidav.fs_dav_provider import FilesystemProvider


#===============================================================================
# WsgiDAVServerTest
#===============================================================================

@unittest.skipIf(os.environ.get("TRAVIS") == "true", "Skipping litmus suite on Travis")
class WsgiDAVLitmusTest(unittest.TestCase):
    """Run litmus test suite against builtin server."""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def _report_missing_litmus(self):
        print("*" * 70)
        print("This test requires the litmus test suite.")
        print("See http://www.webdav.org/neon/litmus/")
        print("*" * 70)

    def test_litmus_with_authentication(self):
        """Run litmus test suite on HTTP with authentification."""
        with WsgiDavTestServer(with_auth=True, with_ssl=False):
            try:
                res = subprocess.call(["litmus", "http://127.0.0.1:8080/", "tester", "secret"])
                self.assertEqual(res, 0, "litmus suite failed: check the log")
            except OSError:
                self._report_missing_litmus()
                raise<commit_msg>Skip litmus test gracefully if suite is not installed<commit_after># -*- coding: iso-8859-1 -*-
# (c) 2009-2016 <NAME> and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
    Run litmus against WsgiDAV server.
"""
from __future__ import print_function

# from multiprocessing.process import Process
from multiprocessing import Process
import os
import subprocess
import sys
from tempfile import gettempdir
import time
import unittest

from tests.util import WsgiDavTestServer
from wsgidav.wsgidav_app import DEFAULT_CONFIG, WsgiDAVApp
from wsgidav.fs_dav_provider import FilesystemProvider


#===============================================================================
# WsgiDAVServerTest
#===============================================================================

@unittest.skipIf(os.environ.get("TRAVIS") == "true", "Skipping litmus suite on Travis")
class WsgiDAVLitmusTest(unittest.TestCase):
    """Run litmus test suite against builtin server."""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def _report_missing_litmus(self):
        print("*" * 70)
        print("This test requires the litmus test suite.")
        print("See http://www.webdav.org/neon/litmus/")
        print("*" * 70)
        raise unittest.SkipTest("Test requires litmus test suite")

    def test_litmus_with_authentication(self):
        """Run litmus test suite on HTTP with authentification."""
        with WsgiDavTestServer(with_auth=True, with_ssl=False):
            try:
                res = subprocess.call(["litmus", "http://127.0.0.1:8080/", "tester", "secret"])
                self.assertEqual(res, 0, "litmus suite failed: check the log")
            except OSError:
                self._report_missing_litmus()
                raise
{'fraction_non_alphanumeric': 0.18349381017881705, 'fraction_numerical': 0.016506189821182942, 'mean_word_length': 3.685567010309278, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, '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': '770048', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1012, 'n_words': 273}