Skip to content

Commit

Permalink
Rename Proposal Project (#52)
Browse files Browse the repository at this point in the history
This renames all references of proposal and changes them to project.

Signed-off-by: David Brown <dmlb2000@gmail.com>
  • Loading branch information
dmlb2000 committed Mar 12, 2019
1 parent 127b621 commit 2cbf403
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
@@ -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
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
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
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
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
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
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
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

0 comments on commit 2cbf403

Please sign in to comment.