Skip to content

Commit

Permalink
Merge 9d948a7 into 9cc283e
Browse files Browse the repository at this point in the history
  • Loading branch information
emielverstegen committed Jun 3, 2019
2 parents 9cc283e + 9d948a7 commit 3584d5d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Changelog of threedi-scenario-downloader
===================================================

0.10 (unreleased)
0.11 (unreleased)
-----------------

- Updated find_scenarios method. Use 'name' argument for exact searches and 'name__icontains' for partial searches


0.10 (2019-05-27)
-----------------

- Increased download chunk size
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

version = "0.10.dev0"
version = "0.11.dev0"
long_description = "\n\n".join([open("README.rst").read(), open("CHANGES.rst").read()])
install_requires = ["requests"]
tests_require = ["pytest", "mock", "pytest-cov", "pytest-flakes", "pytest-black"]
Expand Down
3 changes: 2 additions & 1 deletion threedi_scenario_downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
log = logging.getLogger()

SCENARIO_FILTERS = {
"name": "name__icontains",
"name": "name",
"name__icontains": "name__icontains",
"uuid": "uuid",
"id": "id",
"model_revision": "model_revision",
Expand Down
10 changes: 7 additions & 3 deletions threedi_scenario_downloader/tests/test_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ def test_get_headers():


def test_find_scenario():
r1 = downloader.find_scenarios(name="ardapitest_txloffg")
r2 = downloader.find_scenarios(name="ardapitest_txloffg", model_revision=19)
r3 = downloader.find_scenarios(name="ardapitest_txloffg", model_revision=9)
r1 = downloader.find_scenarios(name__icontains="ardapitest_txloffg")
r2 = downloader.find_scenarios(
name__icontains="ardapitest_txloffg", model_revision=19
)
r3 = downloader.find_scenarios(
name__icontains="ardapitest_txloffg", model_revision=9
)

assert (
r1[0]["uuid"] == "06c38953-31ec-4f6d-ae1f-ccdf31a348ae"
Expand Down

0 comments on commit 3584d5d

Please sign in to comment.