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.
Files changed (28) hide show
  1. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/CHANGELOG +2 -0
  2. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/PKG-INFO +1 -1
  3. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/_version_save.py +1 -1
  4. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/testing.py +5 -2
  5. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/PKG-INFO +1 -1
  6. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/SOURCES.txt +2 -1
  7. dcor_shared-0.7.2/tests/test_testing.py +46 -0
  8. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/LICENSE +0 -0
  9. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/MANIFEST.in +0 -0
  10. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/README.rst +0 -0
  11. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/__init__.py +0 -0
  12. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/_version.py +0 -0
  13. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/ckan.py +0 -0
  14. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/data.py +0 -0
  15. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/mime.py +0 -0
  16. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/parse.py +0 -0
  17. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/paths.py +0 -0
  18. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/s3.py +0 -0
  19. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared/s3cc.py +0 -0
  20. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/dependency_links.txt +0 -0
  21. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/requires.txt +0 -0
  22. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/dcor_shared.egg-info/top_level.txt +0 -0
  23. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/setup.cfg +0 -0
  24. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/setup.py +0 -0
  25. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_basic.py +0 -0
  26. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_data.py +0 -0
  27. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_s3.py +0 -0
  28. {dcor_shared-0.7.1 → dcor_shared-0.7.2}/tests/test_s3cc.py +0 -0
@@ -1,3 +1,5 @@
1
+ 0.7.2
2
+ - tests: fix invalid make_dataset method
1
3
  0.7.1
2
4
  - fix: handle non-existent bucket when S3 object is missing
3
5
  - docs: be more verbose in s3cc docstrings
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcor_shared
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Functionalities shared by the DCOR CKAN extensions
5
5
  Home-page: https://github.com/DCOR-dev/dcor_shared
6
6
  Author: Paul Müller
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env python
2
2
  # This file was created automatically
3
- longversion = '0.7.1'
3
+ longversion = '0.7.2'
@@ -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(create_with_upload, create_context, ds["id"])
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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcor-shared
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Functionalities shared by the DCOR CKAN extensions
5
5
  Home-page: https://github.com/DCOR-dev/dcor_shared
6
6
  Author: Paul Müller
@@ -23,4 +23,5 @@ dcor_shared.egg-info/top_level.txt
23
23
  tests/test_basic.py
24
24
  tests/test_data.py
25
25
  tests/test_s3.py
26
- tests/test_s3cc.py
26
+ tests/test_s3cc.py
27
+ tests/test_testing.py
@@ -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