dcor-shared 0.7.1__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/CHANGELOG +2 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/PKG-INFO +1 -1
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/_version_save.py +1 -1
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/testing.py +5 -2
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/PKG-INFO +1 -1
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/SOURCES.txt +2 -1
- dcor_shared-0.7.2/tests/test_testing.py +46 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/LICENSE +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/MANIFEST.in +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/README.rst +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/__init__.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/_version.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/ckan.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/data.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/mime.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/parse.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/paths.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/s3.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/s3cc.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/dependency_links.txt +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/requires.txt +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/top_level.txt +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/setup.cfg +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/setup.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_basic.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_data.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_s3.py +0 -0
- {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_s3cc.py +0 -0
|
@@ -35,7 +35,7 @@ def create_with_upload_no_temp(clean_db, ckan_config, monkeypatch):
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
def make_dataset(create_context, owner_org, create_with_upload=None,
|
|
38
|
-
activate=False, **kwargs):
|
|
38
|
+
resource_path=None, activate=False, **kwargs):
|
|
39
39
|
if "title" not in kwargs:
|
|
40
40
|
kwargs["title"] = "test-dataset"
|
|
41
41
|
if "authors" not in kwargs:
|
|
@@ -52,7 +52,10 @@ def make_dataset(create_context, owner_org, create_with_upload=None,
|
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
if create_with_upload is not None:
|
|
55
|
-
rs = make_resource(
|
|
55
|
+
rs = make_resource(resource_path=resource_path,
|
|
56
|
+
create_with_upload=create_with_upload,
|
|
57
|
+
create_context=create_context,
|
|
58
|
+
dataset_id=ds["id"])
|
|
56
59
|
|
|
57
60
|
if activate:
|
|
58
61
|
helpers.call_action("package_patch", create_context,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import pathlib
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
import ckan.tests.factories as factories
|
|
5
|
+
|
|
6
|
+
from dcor_shared.testing import make_dataset
|
|
7
|
+
|
|
8
|
+
data_path = pathlib.Path(__file__).parent / "data"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.mark.ckan_config('ckan.plugins', 'dcor_schemas')
|
|
12
|
+
@pytest.mark.usefixtures('clean_db', 'with_request_context')
|
|
13
|
+
def test_make_dataset():
|
|
14
|
+
user = factories.User()
|
|
15
|
+
owner_org = factories.Organization(users=[{
|
|
16
|
+
'name': user['id'],
|
|
17
|
+
'capacity': 'admin'
|
|
18
|
+
}])
|
|
19
|
+
# Note: `call_action` bypasses authorization!
|
|
20
|
+
create_context = {'ignore_auth': False,
|
|
21
|
+
'user': user['name'], 'api_version': 3}
|
|
22
|
+
ds_dict = make_dataset(create_context, owner_org,
|
|
23
|
+
activate=False)
|
|
24
|
+
assert ds_dict["state"] == "draft"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@pytest.mark.ckan_config('ckan.plugins', 'dcor_schemas')
|
|
28
|
+
@pytest.mark.usefixtures('clean_db', 'with_request_context')
|
|
29
|
+
def test_make_dataset_with_resource(create_with_upload):
|
|
30
|
+
user = factories.User()
|
|
31
|
+
owner_org = factories.Organization(users=[{
|
|
32
|
+
'name': user['id'],
|
|
33
|
+
'capacity': 'admin'
|
|
34
|
+
}])
|
|
35
|
+
# Note: `call_action` bypasses authorization!
|
|
36
|
+
create_context = {'ignore_auth': False,
|
|
37
|
+
'user': user['name'], 'api_version': 3}
|
|
38
|
+
# upload a *valid* [sic] .rtdc File (this is the control)
|
|
39
|
+
ds_dict, res_dict = make_dataset(
|
|
40
|
+
create_context, owner_org,
|
|
41
|
+
create_with_upload=create_with_upload,
|
|
42
|
+
resource_path=data_path / "calibration_beads_47.rtdc",
|
|
43
|
+
activate=True)
|
|
44
|
+
assert len(ds_dict["resources"]) == 1
|
|
45
|
+
assert "id" in res_dict
|
|
46
|
+
assert res_dict["package_id"] == ds_dict["id"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|