File: test_clean_log.py

package info (click to toggle)
sphinx-needs 5.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,924 kB
  • sloc: python: 21,132; javascript: 187; makefile: 89; sh: 29; xml: 10
file content (28 lines) | stat: -rw-r--r-- 952 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import unittest

from sphinx_needs.utils import clean_log


class CleanLogTestCase(unittest.TestCase):
    def test_external_needs_clean_log(self):
        self.assertEqual(
            clean_log("http://user:password@host.url/"), "http://****:****@host.url/"
        )
        self.assertEqual(
            clean_log(
                "Downloading file from https://daniel:my_password@server.com now"
            ),
            "Downloading file from https://****:****@server.com now",
        )
        self.assertEqual(
            clean_log(
                "json_path and json_url are both configured, but only one is allowed. "
                "json_path: '/v1/needs.json' json_url: 'www.divstack:pswd@gh.com'."
            ),
            "json_path and json_url are both configured, but only one is allowed. "
            "json_path: '/v1/needs.json' json_url: 'www.****:****@gh.com'.",
        )


if __name__ == "__main__":
    unittest.main()