Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-mkp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
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
checkmk
python-mkp
Commits
7afb735a
Commit
7afb735a
authored
4 years ago
by
Thomas Reifenberger
Browse files
Options
Downloads
Patches
Plain Diff
Add num_files field
parent
8204728d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mkp/__init__.py
+1
-0
1 addition, 0 deletions
mkp/__init__.py
test/integration/test_mkp.py
+6
-0
6 additions, 0 deletions
test/integration/test_mkp.py
with
7 additions
and
0 deletions
mkp/__init__.py
+
1
−
0
View file @
7afb735a
...
...
@@ -28,6 +28,7 @@ def dist(info, path=None):
path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
main
.
__file__
))
info
[
'
files
'
]
=
find_files
(
path
)
info
[
'
num_files
'
]
=
sum
(
len
(
file_list
)
for
file_list
in
info
[
'
files
'
].
values
())
dist_dir
=
os
.
path
.
join
(
path
,
_DIST_DIR
)
filename
=
'
{}-{}.mkp
'
.
format
(
info
[
'
name
'
],
info
[
'
version
'
])
...
...
This diff is collapsed.
Click to expand it.
test/integration/test_mkp.py
+
6
−
0
View file @
7afb735a
...
...
@@ -137,6 +137,8 @@ def test_dist(tmpdir):
'
author
'
:
'
John Doe
'
,
'
name
'
:
'
foo
'
,
'
version
'
:
'
42
'
,
'
version.min_required
'
:
'
1.2.6p5
'
,
'
version.usable_until
'
:
None
,
}
mkp
.
dist
(
info
,
str
(
tmpdir
))
...
...
@@ -147,8 +149,11 @@ def test_dist(tmpdir):
assert
package
.
info
[
'
name
'
]
==
'
foo
'
assert
package
.
info
[
'
files
'
][
'
agents
'
]
==
[
'
special/agent_test
'
]
assert
package
.
info
[
'
files
'
][
'
checks
'
]
==
[
'
foo
'
]
assert
package
.
info
[
'
num_files
'
]
==
2
assert
package
.
info
[
'
version
'
]
==
'
42
'
assert
package
.
info
[
'
version.packaged
'
]
==
'
python-mkp
'
assert
package
.
info
[
'
version.min_required
'
]
==
'
1.2.6p5
'
assert
package
.
info
[
'
version.usable_until
'
]
is
None
def
test_dist_uses_script_path_when_no_path_is_given
(
tmpdir
):
...
...
@@ -179,3 +184,4 @@ dist({
assert
package
.
info
[
'
files
'
][
'
checks
'
]
==
[
'
foo
'
]
assert
package
.
info
[
'
version
'
]
==
'
42
'
assert
package
.
info
[
'
version.packaged
'
]
==
'
python-mkp
'
assert
package
.
info
[
'
num_files
'
]
==
2
\ No newline at end of file
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