Skip to content

Commit 6f7f8d0

Browse files
Add formattedcode tests with yaml encoded strings
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent c77e724 commit 6f7f8d0

10 files changed

Lines changed: 5868 additions & 0 deletions

File tree

tests/formattedcode/data/common/manifests-expected.json

Lines changed: 1588 additions & 0 deletions
Large diffs are not rendered by default.

tests/formattedcode/data/common/manifests-expected.jsonlines

Lines changed: 1659 additions & 0 deletions
Large diffs are not rendered by default.

tests/formattedcode/data/common/manifests-expected.yaml

Lines changed: 2370 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<project
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
6+
<modelVersion>4.0.0</modelVersion>
7+
<groupId>javax.persistence</groupId>
8+
<artifactId>persistence-api</artifactId>
9+
<version>1.0</version>
10+
<name>Enterprise JavaBeans (EJB) 3.0</name>
11+
<description>
12+
The Enterprise JavaBeans architecture is a component architecture for the development and deployment of component-based business applications.
13+
The purpose of Enterprise JavaBeans (EJB) 3.0 is to improve the EJB architecture by reducing its complexity from the developer's point of view.
14+
</description>
15+
<url>http://www.jcp.org/en/jsr/detail?id=220</url>
16+
17+
<licenses>
18+
<license>
19+
<name>Common Development and Distribution License (CDDL) v1.0</name>
20+
<url>http://www.sun.com/cddl/cddl.html</url>
21+
<distribution>repo</distribution>
22+
</license>
23+
</licenses>
24+
25+
<build>
26+
<plugins>
27+
<plugin>
28+
<artifactId>maven-compiler-plugin</artifactId>
29+
<configuration>
30+
<source>1.5</source>
31+
<target>1.5</target>
32+
</configuration>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
37+
</project>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "grunt-esvm",
3+
"description": "Create elasticsearch clusters from grunt.",
4+
"version": "3.2.8",
5+
"homepage": "https://github.com/spenceralger/grunt-esvm",
6+
"license": "Apache-2.0",
7+
"author": {
8+
"name": "Spencer Alger",
9+
"email": "spencer.alger@elasticsearch.com"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git://github.com/spenceralger/grunt-esvm.git"
14+
},
15+
"bugs": {
16+
"url": "https://github.com/spenceralger/grunt-esvm/issues"
17+
},
18+
"licenses": [
19+
{
20+
"type": "Apache 2.0",
21+
"url": "https://github.com/spenceralger/grunt-esvm/blob/master/LICENSE.md"
22+
}
23+
],
24+
"engines": {
25+
"node": ">= 0.8.0"
26+
},
27+
"scripts": {
28+
"test": "grunt test"
29+
},
30+
"devDependencies": {
31+
"grunt": ">=0.4.0",
32+
"load-grunt-config": "~0.19.0"
33+
},
34+
"peerDependencies": {
35+
"grunt": ">=0.4.0"
36+
},
37+
"keywords": [
38+
"gruntplugin"
39+
],
40+
"dependencies": {
41+
"bluebird": "^2.9.30",
42+
"cli-color": "~0.3.2",
43+
"cli-table": "~0.3.0",
44+
"libesvm": "^3.8.2",
45+
"lodash": "^3.9.3",
46+
"moment": "^2.10.3",
47+
"wreck": "^5.6.0"
48+
}
49+
}
50+
51+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "angular-compare-validator",
3+
"version": "0.1.1",
4+
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/GeorgDangl/angular-compare-validator.git"
8+
},
9+
"description": "Angular form validation directive to compare two inputs",
10+
"main": "./dist/index.js",
11+
"typings": "./dist/index",
12+
"dependencies": {
13+
"@angular/core": ">=2.0.0",
14+
"@angular/forms": ">=2.0.0",
15+
"@angular/common": ">=2.0.0",
16+
"rxjs": ">=5.0.0-beta.12",
17+
"zone.js": ">=0.6.21"
18+
},
19+
"bugs": {
20+
"url": "https://github.com/GeorgDangl/angular-compare-validator/issues"
21+
},
22+
"homepage": "https://github.com/GeorgDangl/angular-compare-validator#readme",
23+
"_id": "angular-compare-validator@0.1.1",
24+
"_npmVersion": "5.2.0",
25+
"_nodeVersion": "7.7.1",
26+
"_npmUser": {
27+
"name": "georgdangl",
28+
"email": "npm@dan.gl"
29+
},
30+
"dist": {
31+
"integrity": "sha512-j3DtXjUTGFrVj7KjEUdprJPd1og2zokUblhvwD4DrJPc+x8RNUrCb0CLdcDr9RZj1eTo4nw4dSo8Br3edJp8Aw==",
32+
"shasum": "d35a0754c8587b0502874e3636cf0f19565d09b7",
33+
"tarball": "https://registry.npmjs.org/angular-compare-validator/-/angular-compare-validator-0.1.1.tgz"
34+
},
35+
"maintainers": [
36+
{
37+
"name": "georgdangl",
38+
"email": "npm@dan.gl"
39+
}
40+
],
41+
"_npmOperationalInternal": {
42+
"host": "s3://npm-registry-packages",
43+
"tmp": "tmp/angular-compare-validator-0.1.1.tgz_1506372149543_0.2524787310976535"
44+
}
45+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/bin/env python
2+
"""BluePyOpt setup """
3+
4+
"""
5+
Copyright (c) 2016-2020, EPFL/Blue Brain Project
6+
7+
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
8+
9+
This library is free software; you can redistribute it and/or modify it under
10+
the terms of the GNU Lesser General Public License version 3.0 as published
11+
by the Free Software Foundation.
12+
13+
This library is distributed in the hope that it will be useful, but WITHOUT
14+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15+
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16+
details.
17+
18+
You should have received a copy of the GNU Lesser General Public License
19+
along with this library; if not, write to the Free Software Foundation, Inc.,
20+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21+
"""
22+
23+
import setuptools
24+
import versioneer
25+
26+
27+
EXTRA_SCOOP = [
28+
'scoop>=0.7',
29+
]
30+
31+
setuptools.setup(
32+
name="bluepyopt",
33+
version=versioneer.get_version(),
34+
cmdclass=versioneer.get_cmdclass(),
35+
install_requires=[
36+
'numpy>=1.6',
37+
'pandas>=0.18',
38+
'deap',
39+
'efel>=2.13',
40+
'ipyparallel',
41+
'pickleshare>=0.7.3',
42+
'Jinja2>=2.8',
43+
'future',
44+
'Pebble>=4.3.10'
45+
],
46+
extras_require={
47+
'all': EXTRA_SCOOP,
48+
'scoop': EXTRA_SCOOP,
49+
},
50+
packages=setuptools.find_packages(
51+
exclude=(
52+
'examples',
53+
)),
54+
author="BlueBrain Project, EPFL",
55+
author_email="werner.vangeit@epfl.ch",
56+
description="Bluebrain Python Optimisation Library (bluepyopt)",
57+
long_description="The Blue Brain Python Optimisation Library (BluePyOpt) "
58+
"is an extensible framework for data-driven model parameter "
59+
"optimisation that wraps and standardises several existing "
60+
"open-source tools. It simplifies the task of creating and "
61+
"sharing these optimisations, and the associated techniques "
62+
"and knowledge. This is achieved by abstracting the optimisation "
63+
"and evaluation tasks into various reusable and flexible discrete "
64+
"elements according to established best-practices.",
65+
license="LGPLv3",
66+
keywords=(
67+
'optimisation',
68+
'neuroscience',
69+
'BlueBrainProject'),
70+
url='https://github.com/BlueBrain/BluePyOpt',
71+
classifiers=[
72+
'Development Status :: 5 - Production/Stable',
73+
'Environment :: Console',
74+
'License :: OSI Approved :: GNU Lesser General Public '
75+
'License v3 (LGPLv3)',
76+
'Programming Language :: Python :: 3 :: Only',
77+
'Operating System :: POSIX',
78+
'Topic :: Scientific/Engineering',
79+
'Topic :: Utilities'],
80+
entry_points={
81+
'console_scripts': ['bpopt_tasksdb=bluepyopt.ipyp.bpopt_tasksdb:main'],
82+
},
83+
package_data={
84+
'bluepyopt': [
85+
'ephys/templates/cell_template.jinja2',
86+
'ephys/examples/simplecell/simple.swc'],
87+
})

tests/formattedcode/test_output_json.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ def test_json_compact():
4343
check_json_scan(expected, result_file, remove_file_date=True, regen=REGEN_TEST_FIXTURES)
4444

4545

46+
def test_json_with_extracted_license_statements():
47+
test_dir = test_env.get_test_loc('common/manifests')
48+
result_file = test_env.get_temp_file('json')
49+
run_scan_click(['-clip', test_dir, '--json', result_file])
50+
expected = test_env.get_test_loc('common/manifests-expected.json')
51+
check_json_scan(expected, result_file, remove_file_date=True, regen=REGEN_TEST_FIXTURES)
52+
53+
4654
@pytest.mark.scanslow
4755
def test_scan_output_does_not_truncate_copyright_json():
4856
test_dir = test_env.get_test_loc('json/tree/scan/')

tests/formattedcode/test_output_jsonlines.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ def test_jsonlines():
3333
remove_file_date=True, regen=REGEN_TEST_FIXTURES)
3434

3535

36+
def test_jsonlines_with_package_and_license():
37+
test_dir = test_env.get_test_loc('common/manifests')
38+
result_file = test_env.get_temp_file('jsonline')
39+
run_scan_click(['-clip', test_dir, '--json-lines', result_file])
40+
expected = test_env.get_test_loc('common/manifests-expected.jsonlines')
41+
check_jsonlines_scan(
42+
test_env.get_test_loc(expected), result_file,
43+
remove_file_date=True, regen=REGEN_TEST_FIXTURES)
44+
45+
3646
def test_jsonlines_with_timing():
3747
test_dir = test_env.get_test_loc('json/simple')
3848
result_file = test_env.get_temp_file('jsonline')

tests/formattedcode/test_output_yaml.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ def test_scan_produces_valid_yaml():
6464
data = saneyaml.load(open(result_file).read())
6565

6666

67+
def test_scan_produces_valid_yaml_with_extracted_license_statements():
68+
test_dir = test_env.get_test_loc('common/manifests')
69+
result_file = test_env.get_temp_file('json')
70+
args = [
71+
'-clipeu', '--license-text', '--classify', '--summary', '--license-references',
72+
'--license-clarity-score', test_dir, '--yaml', result_file]
73+
run_scan_click(args)
74+
expected = test_env.get_test_loc('common/manifests-expected.yaml')
75+
check_yaml_scan(expected, result_file, regen=REGEN_TEST_FIXTURES)
76+
data = saneyaml.load(open(result_file).read())
77+
78+
79+
6780
def check_yaml_scan(
6881
expected_file,
6982
result_file,

0 commit comments

Comments
 (0)