FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GitPython/test/test_clone.py at fix · CoderPuppy/GitPython · GitHub
CoderPuppy
GitPython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
GitPython
/
test
/
test_clone.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (26 loc) · 1.1 KB
Breadcrumbs
GitPython
/
test
/
test_clone.py
Copy path
File metadata and controls
32 lines (26 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
29
30
31
32
# -*- coding: utf-8 -*-
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from
pathlib
import
Path
import
re
import
git
from
.
lib
import
(
TestBase
,
with_rw_directory
,
)
class
TestClone
(
TestBase
):
@
with_rw_directory
def
test_checkout_in_non_empty_dir
(
self
,
rw_dir
):
non_empty_dir
=
Path
(
rw_dir
)
garbage_file
=
non_empty_dir
/
'not-empty'
garbage_file
.
write_text
(
'Garbage!'
)
# Verify that cloning into the non-empty dir fails while complaining about
# the target directory not being empty/non-existent
try
:
self
.
rorepo
.
clone
(
non_empty_dir
)
except
git
.
GitCommandError
as
exc
:
self
.
assertTrue
(
exc
.
stderr
,
"GitCommandError's 'stderr' is unexpectedly empty"
)
expr
=
re
.
compile
(
r'(?is).*\bfatal:\s+destination\s+path\b.*\bexists\b.*\bnot\b.*\bempty\s+directory\b'
)
self
.
assertTrue
(
expr
.
search
(
exc
.
stderr
),
'"%s" does not match "%s"'
%
(
expr
.
pattern
,
exc
.
stderr
))
else
:
self
.
fail
(
"GitCommandError not raised"
)
Back
|
FazBrowse Home
|
New Git URL