Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Proposal Project #52

Merged
merged 1 commit into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.4.2
rev: v1.4.3
hooks:
- id: autopep8
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
rev: v2.1.0
hooks:
- id: fix-encoding-pragma
- id: trailing-whitespace
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ install:
C:\pacifica\Scripts\activate.ps1;
python -m pip install pip setuptools wheel --upgrade;
pip install -r requirements-dev.txt;
pip install celery[redis] eventlet;
pip install celery[redis] eventlet redis;
echo 'Done';


Expand Down
34 changes: 17 additions & 17 deletions tests/metaupdate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,50 +81,50 @@ def test_update_parents(self):
)
md_update.append(
MetaObj(
destinationTable='Transactions.proposal',
destinationTable='Transactions.project',
displayFormat='%(_id)s %(title)s',
displayTitle='Proposal',
displayTitle='Project',
displayType='select',
metaID='ProposalByInstrument',
metaID='ProjectByInstrument',
queryDependency={'instrument_id': 'instrumentByID'},
queryFields=['title', '_id'],
sourceTable='proposals',
sourceTable='projects',
value=None,
valueField='_id'
)
)
md_update.append(
MetaObj(
displayFormat=u'Proposal ID {_id}',
displayFormat=u'Project ID {_id}',
directoryOrder=0,
displayType='directoryTree',
metaID='ProposalIDDirectory',
queryDependency={'_id': 'ProposalByInstrument'},
metaID='ProjectIDDirectory',
queryDependency={'_id': 'ProjectByInstrument'},
queryFields=['_id'],
sourceTable='proposals',
sourceTable='projects',
value=None,
valueField='_id'
)
)
md_update.append(
MetaObj(
displayFormat=u'Proposal Title ({title})',
displayFormat=u'Project Title ({title})',
directoryOrder=1,
displayType='directoryTree',
metaID='ProposalTitleDirectory',
queryDependency={'_id': 'ProposalByInstrument'},
metaID='ProjectTitleDirectory',
queryDependency={'_id': 'ProjectByInstrument'},
queryFields=['_id', 'title'],
sourceTable='proposals',
sourceTable='projects',
value=None,
valueField='_id'
)
)
md_update.update_parents('ProposalIDDirectory')
md_update.update_parents('ProposalTitleDirectory')
self.assertTrue(md_update['ProposalByInstrument'].value)
self.assertEqual(md_update['ProposalIDDirectory'].value, u'1234a')
md_update.update_parents('ProjectIDDirectory')
md_update.update_parents('ProjectTitleDirectory')
self.assertTrue(md_update['ProjectByInstrument'].value)
self.assertEqual(md_update['ProjectIDDirectory'].value, u'1234a')
self.assertEqual(
md_update.directory_prefix(),
u'Proposal ID 1234a/Proposal Title (Pacifica D\xe9velopment (active no close))'
u'Project ID 1234a/Project Title (Pacifica D\xe9velopment (active no close))'
)
self.assertTrue(md_update.is_valid())
2 changes: 1 addition & 1 deletion tests/policyquery_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_valid_metadata(self):
policyquery = PolicyQuery(user=10)
md_obj = metadata_decode("""[
{ "destinationTable": "Transactions.submitter", "value": 10 },
{ "destinationTable": "Transactions.proposal", "value": "1234a" },
{ "destinationTable": "Transactions.project", "value": "1234a" },
{ "destinationTable": "Transactions.instrument", "value": 54 }
]""")
result = policyquery.valid_metadata(md_obj)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/good-md.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"value": 10
},
{
"destinationTable": "Transactions.proposal",
"destinationTable": "Transactions.project",
"value": "1234a"
},
{
Expand Down
18 changes: 9 additions & 9 deletions tests/test_data/ref/uploader-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,34 @@
"valueField": "_id"
},
{
"destinationTable": "Transactions.proposal",
"destinationTable": "Transactions.project",
"displayFormat": "%(_id)s %(title)s",
"displayTitle": "Proposal",
"displayTitle": "Project",
"displayType": "select",
"metaID": "ProposalByInstrument",
"metaID": "ProjectByInstrument",
"queryDependency": {
"_id": "ProposalByInstrument"
"_id": "ProjectByInstrument"
},
"queryFields": [
"_id",
"title"
],
"sourceTable": "proposals",
"sourceTable": "projects",
"value": "",
"valueField": "_id"
},
{
"directoryOrder": 0,
"displayFormat": "Dave is a twit %(_id)s",
"displayType": "directoryTree",
"metaID": "ProposalDirectory",
"metaID": "ProjectDirectory",
"queryDependency": {
"_id": "ProposalByInstrument"
"_id": "ProjectByInstrument"
},
"queryFields": [
"_id"
],
"sourceTable": "proposals",
"sourceTable": "projects",
"value": "45796",
"valueField": "_id"
},
Expand All @@ -99,7 +99,7 @@
"key": "User of Record",
"metaID": "EmslUserOfRecord",
"queryDependency": {
"proposal_id": "ProposalByInstrument"
"project_id": "ProjectByInstrument"
},
"queryFields": [
"first_name",
Expand Down
18 changes: 9 additions & 9 deletions tests/test_data/up-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,34 @@
"valueField": "_id"
},
{
"destinationTable": "Transactions.proposal",
"destinationTable": "Transactions.project",
"displayFormat": "%(_id)s %(title)s",
"displayTitle": "Proposal",
"displayTitle": "Project",
"displayType": "select",
"metaID": "ProposalByInstrument",
"metaID": "ProjectByInstrument",
"queryDependency": {
"_id": "ProposalByInstrument"
"_id": "ProjectByInstrument"
},
"queryFields": [
"_id",
"title"
],
"sourceTable": "proposals",
"sourceTable": "projects",
"value": "",
"valueField": "_id"
},
{
"directoryOrder": 0,
"displayFormat": "Dave is a twit %(_id)s",
"displayType": "directoryTree",
"metaID": "ProposalDirectory",
"metaID": "ProjectDirectory",
"queryDependency": {
"_id": "ProposalByInstrument"
"_id": "ProjectByInstrument"
},
"queryFields": [
"_id"
],
"sourceTable": "proposals",
"sourceTable": "projects",
"value": "45796",
"valueField": "_id"
},
Expand All @@ -90,7 +90,7 @@
"key": "User of Record",
"metaID": "InstUserOfRecord",
"queryDependency": {
"proposal_id": "ProposalByInstrument"
"project_id": "ProjectByInstrument"
},
"queryFields": [
"first_name",
Expand Down
2 changes: 1 addition & 1 deletion tests/uploader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_upload_basic(self):
[
MetaObj(destinationTable='Transactions._id', value=1234),
MetaObj(destinationTable='Transactions.submitter', value=10),
MetaObj(destinationTable='Transactions.proposal',
MetaObj(destinationTable='Transactions.project',
value=u'1234a'),
MetaObj(destinationTable='Transactions.instrument', value=54)
]
Expand Down