Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
mutalyzer
Commits
763ab1f7
Commit
763ab1f7
authored
10 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Announcement in info webservice method
Closes #11
parent
d7e5a404
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
mutalyzer/models.py
+2
-0
2 additions, 0 deletions
mutalyzer/models.py
mutalyzer/services/rpc.py
+9
-0
9 additions, 0 deletions
mutalyzer/services/rpc.py
tests/test_services_json.py
+19
-0
19 additions, 0 deletions
tests/test_services_json.py
tests/test_website.py
+20
-1
20 additions, 1 deletion
tests/test_website.py
with
50 additions
and
1 deletion
mutalyzer/models.py
+
2
−
0
View file @
763ab1f7
...
...
@@ -290,6 +290,8 @@ class InfoOutput(ComplexModel):
nomenclatureVersionParts
=
Array
(
String
)
serverName
=
String
contactEmail
=
String
announcement
=
String
announcementUrl
=
String
#InfoOutput
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/services/rpc.py
+
9
−
0
View file @
763ab1f7
...
...
@@ -29,6 +29,7 @@ from mutalyzer.db.models import (Assembly, Chromosome, BatchJob,
from
mutalyzer.output
import
Output
from
mutalyzer.grammar
import
Grammar
from
mutalyzer.sync
import
CacheSync
from
mutalyzer
import
announce
from
mutalyzer
import
stats
from
mutalyzer
import
variantchecker
from
mutalyzer.mapping
import
Converter
...
...
@@ -1160,6 +1161,9 @@ class MutalyzerService(ServiceBase):
version as a list of strings.
- serverName: The name of the server that is being queried.
- contactEmail: The email address to contact for more information.
- announcement: Announcement body text.
- announcementUrl: URL to go with the announcement for further
information.
@rtype: object
"""
output
=
Output
(
__file__
)
...
...
@@ -1177,6 +1181,11 @@ class MutalyzerService(ServiceBase):
result
.
serverName
=
socket
.
gethostname
()
result
.
contactEmail
=
mutalyzer
.
__contact__
announcement
=
announce
.
get_announcement
()
if
announcement
:
result
.
announcement
=
announcement
[
'
body
'
]
result
.
announcementUrl
=
announcement
[
'
url
'
]
output
.
addMessage
(
__file__
,
-
1
,
'
INFO
'
,
'
Finished processing info
'
)
return
result
#info
...
...
This diff is collapsed.
Click to expand it.
tests/test_services_json.py
+
19
−
0
View file @
763ab1f7
...
...
@@ -6,6 +6,7 @@ Tests for the JSON interface to Mutalyzer.
import
simplejson
as
json
from
spyne.server.null
import
NullServer
import
mutalyzer
from
mutalyzer
import
announce
from
mutalyzer.services.json
import
application
from
fixtures
import
database
,
hg19
,
hg19_transcript_mappings
...
...
@@ -78,3 +79,21 @@ class TestServicesJson(MutalyzerTest):
r
=
self
.
_call
(
'
info
'
)
assert
type
(
r
[
'
versionParts
'
])
==
list
assert
r
[
'
version
'
]
==
mutalyzer
.
__version__
def
test_info_announcement
(
self
):
"""
Running the info method should show us the current announcement
"""
announce
.
set_announcement
(
'
Test announcement
'
)
r
=
self
.
_call
(
'
info
'
)
assert
type
(
r
[
'
announcement
'
])
==
str
assert
r
[
'
announcement
'
]
==
'
Test announcement
'
announce
.
set_announcement
(
'
New announcement
'
)
r
=
self
.
_call
(
'
info
'
)
assert
type
(
r
[
'
announcement
'
])
==
str
assert
r
[
'
announcement
'
]
==
'
New announcement
'
announce
.
unset_announcement
()
r
=
self
.
_call
(
'
info
'
)
assert
not
r
.
get
(
'
announcement
'
)
This diff is collapsed.
Click to expand it.
tests/test_website.py
+
20
−
1
View file @
763ab1f7
...
...
@@ -21,7 +21,7 @@ from Bio import Entrez
import
lxml.html
import
mutalyzer
from
mutalyzer
import
Scheduler
from
mutalyzer
import
announce
,
Scheduler
from
mutalyzer.website
import
create_app
from
fixtures
import
cache
,
database
,
hg19
,
hg19_transcript_mappings
...
...
@@ -85,6 +85,25 @@ class TestWebsite(MutalyzerTest):
r
=
self
.
app
.
get
(
href
)
assert
r
.
status_code
==
200
def
test_announcement
(
self
):
"""
We should always see the current announcement.
"""
announce
.
set_announcement
(
'
Test announcement
'
)
r
=
self
.
app
.
get
(
'
/syntax-checker
'
)
assert
r
.
status
==
'
200 OK
'
assert
'
Test announcement
'
in
r
.
data
announce
.
set_announcement
(
'
New announcement
'
)
r
=
self
.
app
.
get
(
'
/syntax-checker
'
)
assert
r
.
status
==
'
200 OK
'
assert
'
New announcement
'
in
r
.
data
announce
.
unset_announcement
()
r
=
self
.
app
.
get
(
'
/syntax-checker
'
)
assert
r
.
status
==
'
200 OK
'
assert
'
nnouncement
'
not
in
r
.
data
def
test_description_extractor
(
self
):
"""
Submit the variant description extractor.
...
...
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