-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some tests for plugins, episodes, middleware and gloss
- Loading branch information
1 parent
14251e4
commit c41b122
Showing
6 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
""" | ||
Unittests for opal.core.episodes | ||
""" | ||
from opal.core import test | ||
|
||
from opal.core import episodes | ||
|
||
class EpisodeTypesTestCas(test.OpalTestCase): | ||
def test_episode_types(self): | ||
self.assertIn(episodes.InpatientEpisode, episodes.episode_types()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Unittests for opal.core.plugins | ||
""" | ||
from opal.core.test import OpalTestCase | ||
|
||
from opal.core import plugins | ||
|
||
class OpalPluginTestCase(OpalTestCase): | ||
def test_list_schemas(self): | ||
self.assertEqual({}, plugins.OpalPlugin().list_schemas()) | ||
|
||
def test_flows(self): | ||
self.assertEqual({}, plugins.OpalPlugin().flows()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Unittests for opal.middleware | ||
""" | ||
from opal.core.test import OpalTestCase | ||
|
||
from opal import middleware | ||
|
||
class AngularCSRFRenameTestCase(OpalTestCase): | ||
def test_process_request(self): | ||
mw = middleware.AngularCSRFRename() | ||
request = self.rf.get('/hai') | ||
request.META['HTTP_X_XSRF_TOKEN'] = 'foo' | ||
mw.process_request(request) | ||
self.assertEqual(request.META['HTTP_X_CSRFTOKEN'], 'foo') | ||
self.assertEqual(request.META.get('HTTP_X_XSRF_TOKEN', None), None) |