Skip to content
Snippets Groups Projects
Commit 7afb735a authored by Thomas Reifenberger's avatar Thomas Reifenberger
Browse files

Add num_files field

parent 8204728d
No related branches found
No related tags found
No related merge requests found
......@@ -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'])
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment