Skip to content

Commit

Permalink
Exclude abstract methods from coverage report (#233)
Browse files Browse the repository at this point in the history
Remove swagger-codegen installation from travis setup and readme
Exclude abstract methods from coverage report
Improve descriptions in swagger doc
  • Loading branch information
paulineribeyre authored Aug 2, 2019
1 parent 48d007f commit 5f101a7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[report]
exclude_lines =
pragma: no cover
raise NotImplementedError
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
# not used anymore:
swagger_client
swagger-codegen-cli-2.3.1.jar

# Translations
*.mo
Expand Down Expand Up @@ -65,6 +67,3 @@ docs/_build/
local_settings.py
settings.yaml
*.sq3

# swagger
swagger-codegen-cli-2.3.1.jar
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
25 changes: 11 additions & 14 deletions openapis/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 != <value>
For list (urls, acl), filter with doc that don't HAS <value>
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 != <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
Expand Down Expand Up @@ -282,7 +279,7 @@ paths:
tags:
- index
summary: Get the metadata associated with the given id
operationId: getEntry
operationId: getIndexEntry
produces:
- application/json
parameters:
Expand Down Expand Up @@ -447,7 +444,7 @@ paths:
tags:
- alias
summary: list aliases with pagination
operationId: listEntries
operationId: listAlistEntries
consumes:
- application/json
produces:
Expand Down Expand Up @@ -541,7 +538,7 @@ paths:
- alias
summary: Fetch an alias
description: ''
operationId: getEntry
operationId: getAliasEntry
consumes:
- application/json
produces:
Expand All @@ -565,7 +562,7 @@ paths:
- alias
summary: Delete an alias
description: ''
operationId: deleteEntry
operationId: deleteAliasEntry
consumes:
- application/json
produces:
Expand Down

0 comments on commit 5f101a7

Please sign in to comment.