Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PEDASI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Research Software Group
PEDASI
Commits
c6bcd5f5
Commit
c6bcd5f5
authored
Feb 19, 2019
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
Fix failing PROV tests caused by invalid plugin name
parent
c30ecd37
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
datasources/migrations/0031_default_connector_name.py
+18
-0
18 additions, 0 deletions
datasources/migrations/0031_default_connector_name.py
datasources/models.py
+1
-0
1 addition, 0 deletions
datasources/models.py
provenance/tests.py
+13
-4
13 additions, 4 deletions
provenance/tests.py
with
32 additions
and
4 deletions
datasources/migrations/0031_default_connector_name.py
0 → 100644
+
18
−
0
View file @
c6bcd5f5
# Generated by Django 2.0.8 on 2019-02-19 10:27
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
datasources
'
,
'
0030_rename_licence
'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'
datasource
'
,
name
=
'
plugin_name
'
,
field
=
models
.
CharField
(
default
=
'
DataSetConnector
'
,
max_length
=
63
),
),
]
This diff is collapsed.
Click to expand it.
datasources/models.py
+
1
−
0
View file @
c6bcd5f5
...
@@ -239,6 +239,7 @@ class DataSource(BaseAppDataModel):
...
@@ -239,6 +239,7 @@ class DataSource(BaseAppDataModel):
#: Name of plugin which allows interaction with this data source
#: Name of plugin which allows interaction with this data source
plugin_name
=
models
.
CharField
(
max_length
=
MAX_LENGTH_NAME
,
plugin_name
=
models
.
CharField
(
max_length
=
MAX_LENGTH_NAME
,
default
=
'
DataSetConnector
'
,
blank
=
False
,
null
=
False
)
blank
=
False
,
null
=
False
)
#: If the data source API requires an API key use this one
#: If the data source API requires an API key use this one
...
...
This diff is collapsed.
Click to expand it.
provenance/tests.py
+
13
−
4
View file @
c6bcd5f5
...
@@ -39,7 +39,6 @@ class ProvEntryTest(TestCase):
...
@@ -39,7 +39,6 @@ class ProvEntryTest(TestCase):
name
=
'
Test Data Source
'
,
name
=
'
Test Data Source
'
,
url
=
'
http://www.example.com
'
,
url
=
'
http://www.example.com
'
,
owner
=
self
.
user
,
owner
=
self
.
user
,
plugin_name
=
'
TEST
'
)
)
def
tearDown
(
self
):
def
tearDown
(
self
):
...
@@ -99,7 +98,6 @@ class ProvWrapperTest(TestCase):
...
@@ -99,7 +98,6 @@ class ProvWrapperTest(TestCase):
name
=
'
Test Data Source
'
,
name
=
'
Test Data Source
'
,
url
=
'
http://www.example.com
'
,
url
=
'
http://www.example.com
'
,
owner
=
self
.
user
,
owner
=
self
.
user
,
plugin_name
=
'
TEST
'
)
)
def
tearDown
(
self
):
def
tearDown
(
self
):
...
@@ -130,12 +128,24 @@ class ProvWrapperTest(TestCase):
...
@@ -130,12 +128,24 @@ class ProvWrapperTest(TestCase):
"""
"""
n_provs
=
self
.
_count_prov
(
self
.
datasource
)
n_provs
=
self
.
_count_prov
(
self
.
datasource
)
self
.
datasource
.
plugin_name
=
'
CHANGED
'
self
.
datasource
.
api_key
=
'
TEST
'
self
.
datasource
.
save
()
self
.
datasource
.
save
()
# Another PROV record should be created when model is changed and saved
# Another PROV record should be created when model is changed and saved
self
.
assertEqual
(
self
.
_count_prov
(
self
.
datasource
),
n_provs
+
1
)
self
.
assertEqual
(
self
.
_count_prov
(
self
.
datasource
),
n_provs
+
1
)
@unittest.expectedFailure
def
test_prov_datasource_no_update
(
self
):
"""
Test that a new :class:`ProvEntry` is not created when a model is saved without changes.
"""
n_provs
=
self
.
_count_prov
(
self
.
datasource
)
self
.
datasource
.
save
()
# Another PROV record should be created when model is changed and saved
self
.
assertEqual
(
self
.
_count_prov
(
self
.
datasource
),
n_provs
)
@unittest.expectedFailure
@unittest.expectedFailure
def
test_prov_datasource_null_update
(
self
):
def
test_prov_datasource_null_update
(
self
):
"""
"""
...
@@ -158,7 +168,6 @@ class ProvWrapperTest(TestCase):
...
@@ -158,7 +168,6 @@ class ProvWrapperTest(TestCase):
name
=
'
Another Test Data Source
'
,
name
=
'
Another Test Data Source
'
,
url
=
'
http://www.example.com
'
,
url
=
'
http://www.example.com
'
,
owner
=
self
.
user
,
owner
=
self
.
user
,
plugin_name
=
'
TEST
'
)
)
new_prov_entries
=
models
.
ProvWrapper
.
filter_model_instance
(
new_datasource
)
new_prov_entries
=
models
.
ProvWrapper
.
filter_model_instance
(
new_datasource
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment