mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 21:04:17 +00:00
remove master references from tests
This commit is contained in:
parent
6db05e22aa
commit
0a0af6796b
3 changed files with 18 additions and 19 deletions
|
|
@ -16,9 +16,9 @@ def test_passing(tmpdir):
|
|||
# tags are ok
|
||||
b'https://github.com/asottile/test/blob/1.0.0/foo%20bar#L1\n'
|
||||
# links to files but not line numbers are ok
|
||||
b'https://github.com/asottile/test/blob/master/foo%20bar\n'
|
||||
b'https://github.com/asottile/test/blob/main/foo%20bar\n'
|
||||
# regression test for overly-greedy regex
|
||||
b'https://github.com/ yes / no ? /blob/master/foo#L1\n',
|
||||
b'https://github.com/ yes / no ? /blob/main/foo#L1\n',
|
||||
)
|
||||
assert not main((str(f),))
|
||||
|
||||
|
|
@ -26,17 +26,15 @@ def test_passing(tmpdir):
|
|||
def test_failing(tmpdir, capsys):
|
||||
with tmpdir.as_cwd():
|
||||
tmpdir.join('f.txt').write_binary(
|
||||
b'https://github.com/asottile/test/blob/master/foo#L1\n'
|
||||
b'https://example.com/asottile/test/blob/master/foo#L1\n'
|
||||
b'https://github.com/asottile/test/blob/main/foo#L1\n'
|
||||
b'https://example.com/asottile/test/blob/main/foo#L1\n',
|
||||
)
|
||||
|
||||
assert main(('f.txt', '--additional-github-domain', 'example.com'))
|
||||
out, _ = capsys.readouterr()
|
||||
assert out == (
|
||||
'f.txt:1:https://github.com/asottile/test/blob/master/foo#L1\n'
|
||||
'f.txt:2:https://example.com/asottile/test/blob/master/foo#L1\n'
|
||||
'f.txt:3:https://example.com/asottile/test/blob/main/foo#L1\n'
|
||||
'f.txt:1:https://github.com/asottile/test/blob/main/foo#L1\n'
|
||||
'f.txt:2:https://example.com/asottile/test/blob/main/foo#L1\n'
|
||||
'\n'
|
||||
'Non-permanent github link detected.\n'
|
||||
'On any page on github press [y] to load a permalink.\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue