Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Debugging Gitlab issue fix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Phileas
Debugging Gitlab issue fix
Commits
3cc95b71
Commit
3cc95b71
authored
1 year ago
by
dos
Committed by
dos
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
sim: Add a few more os mocks
parent
0b6bcb1d
No related branches found
No related tags found
1 merge request
!634
sim: Add a few more os mocks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sim/run.py
+14
-0
14 additions, 0 deletions
sim/run.py
with
14 additions
and
0 deletions
sim/run.py
+
14
−
0
View file @
3cc95b71
...
...
@@ -111,11 +111,25 @@ def _mkmock(fun):
return
_wrap
def
_mkmock2
(
fun
):
orig
=
fun
def
_wrap
(
path1
,
path2
,
*
args
,
**
kwargs
):
path1
=
_path_replace
(
path1
)
path2
=
_path_replace
(
path2
)
return
orig
(
path1
,
path2
,
*
args
,
**
kwargs
)
return
_wrap
os
.
listdir
=
_mkmock
(
os
.
listdir
)
os
.
rename
=
_mkmock2
(
os
.
rename
)
os
.
stat
=
_mkmock
(
os
.
stat
)
os
.
statvfs
=
_mkmock
(
os
.
statvfs
)
os
.
mkdir
=
_mkmock
(
os
.
mkdir
)
os
.
rmdir
=
_mkmock
(
os
.
rmdir
)
os
.
unlink
=
_mkmock
(
os
.
unlink
)
os
.
remove
=
_mkmock
(
os
.
remove
)
builtins
.
open
=
_mkmock
(
builtins
.
open
)
orig_stat
=
os
.
stat
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment