diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..98ee3d07 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,4 @@ +[report] +exclude_lines = + pragma: no cover + raise NotImplementedError diff --git a/.gitignore b/.gitignore index d200c671..bab7f09d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,9 @@ htmlcov/ .cache nosetests.xml coverage.xml +# not used anymore: swagger_client +swagger-codegen-cli-2.3.1.jar # Translations *.mo @@ -65,6 +67,3 @@ docs/_build/ local_settings.py settings.yaml *.sq3 - -# swagger -swagger-codegen-cli-2.3.1.jar diff --git a/.travis.yml b/.travis.yml index 9d89a144..16890c02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,6 @@ jdk: - oraclejdk8 install: - - "wget https://oss.sonatype.org/content/repositories/releases/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar" - - "java -jar swagger-codegen-cli-2.3.1.jar generate -i openapis/swagger.yaml -l python -o swagger_client" - - "cd swagger_client; python setup.py install; cd .." - "python setup.py install --force" - "pip install -r test-requirements.txt" diff --git a/README.md b/README.md index 67309221..184ea33b 100644 --- a/README.md +++ b/README.md @@ -320,17 +320,12 @@ There is specific information about some configuration options in the [distribut ## Testing - Follow [installation](#installation) -- Install [swagger-codegen](https://swagger.io/swagger-codegen/) - Run: ``` pip install -r test-requirements.txt -swagger-codegen generate -i openapis/swagger.yaml -l python -o swagger_client -cd swagger_client; python setup.py develop; cd - py.test -v tests/ ``` -> NOTE: If you experience issues, you can check the `.travis.yml` file in this repo to see how swagger codegen (and which version) is being used for automated unit testing in Travis CI. - ## Testing with Docker Doesn't work with all the DB tests yet, but you can adjust to run specific tests as necessary. diff --git a/openapis/swagger.yaml b/openapis/swagger.yaml index 3dc7663b..e0f1b9f3 100644 --- a/openapis/swagger.yaml +++ b/openapis/swagger.yaml @@ -138,9 +138,7 @@ paths: - name: urls_metadata in: query description: | - urls_metadata in json string format as {url_key: {key: value}, ...} - check doc.url_metadata has key that contains substring url_key - and regular filter on key: value + urls_metadata in JSON string format "{url_key: {key: value, ...}, ...}". Will get records whose url_metadata have at least one key containing the substring "url_key" AND whose url_metadata have all the "key: value" properties required: false type: string - name: metadata @@ -188,13 +186,12 @@ paths: - name: negate_params in: query description: | - All the negate params go in here as the same format with regular params: - pass a Document as a json string with all the negated values. - For string (version, file_name), filter with value != - For list (urls, acl), filter with doc that don't HAS - For dict (metadata, urls_metadata). In each (key,value) pair: - - if value is None or empty: then filter with key doesn't exist - - if value is provided, then filter with value != OR key doesn't exist + The negate params in JSON string format. + For string params (version, file_name): filters value != param value + For list params (urls, acl): filters records that don't include the param value + For dict params (metadata, urls_metadata), for each (key,value) pair: + - if param value is None or empty: filters with key doesn't exist + - if param value is provided: filters with value != param value OR key doesn't exist required: false type: string - name: start @@ -282,7 +279,7 @@ paths: tags: - index summary: Get the metadata associated with the given id - operationId: getEntry + operationId: getIndexEntry produces: - application/json parameters: @@ -447,7 +444,7 @@ paths: tags: - alias summary: list aliases with pagination - operationId: listEntries + operationId: listAlistEntries consumes: - application/json produces: @@ -541,7 +538,7 @@ paths: - alias summary: Fetch an alias description: '' - operationId: getEntry + operationId: getAliasEntry consumes: - application/json produces: @@ -565,7 +562,7 @@ paths: - alias summary: Delete an alias description: '' - operationId: deleteEntry + operationId: deleteAliasEntry consumes: - application/json produces: