GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: exclude fixture paths from credential redaction assertions · gitpython-developers/GitPython@d400a1d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • test_git.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/test_git.py‎

Copy file name to clipboardExpand all lines: test/test_git.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def test_it_redacts_authorization_extra_header_from_error(self):
518518
def test_clone_redacts_config_urls_from_trace_and_error(self, option, expected):
519519
for trace in (True, "full"):
520520
with self.subTest(trace=trace), writable_fixture("repo.sh", "empty") as temporary:
521-
directory = temporary.path()
521+
directory = temporary.path() / "alice-bob-user-token"
522522
with mock.patch.object(Git, "GIT_PYTHON_TRACE", trace):
523523
with self.assertLogs("git.cmd", level="INFO") as logs:
524524
with self.assertRaises(GitCommandError) as context:
@@ -532,6 +532,9 @@ def test_clone_redacts_config_urls_from_trace_and_error(self, option, expected):
532532
message = str(context.exception)
533533
assert logs is not None
534534
log_output = " ".join(logs.output)
535+
for path in (str(directory), directory.as_posix()):
536+
message = message.replace(path, "<fixture>")
537+
log_output = log_output.replace(path, "<fixture>")
535538
self.assertIn(expected, log_output)
536539
for credential in ("alice", "bob", "user", "token"):
537540
self.assertNotIn(credential, message)

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.