This repository has been archived by the owner on Mar 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from mozilla-services/enable-coveralls
Enable coveralls
- Loading branch information
Showing
5 changed files
with
38 additions
and
3 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,26 @@ | ||
import sys | ||
|
||
import mock | ||
|
||
import readinglist | ||
from .support import unittest | ||
|
||
|
||
class GEventActivationTest(unittest.TestCase): | ||
def setUp(self): | ||
self.gevent_mocked = mock.MagicMock() | ||
self.psycogreen_mocked = mock.MagicMock() | ||
sys.modules['gevent'] = self.gevent_mocked | ||
sys.modules['gevent.monkey'] = self.gevent_mocked.monkey | ||
sys.modules['psycogreen'] = self.psycogreen_mocked | ||
sys.modules['psycogreen.gevent'] = self.psycogreen_mocked.gevent | ||
|
||
def test_gevent_is_not_setup_by_default(self): | ||
readinglist.patch_gevent({}) | ||
self.assertFalse(self.gevent_mocked.monkey.patch_socket.called) | ||
self.assertFalse(self.psycogreen_mocked.gevent.patch_psycopg.called) | ||
|
||
def test_gevent_is_activated_from_settings(self): | ||
readinglist.patch_gevent({'readinglist.gevent_enabled': 'true'}) | ||
self.assertTrue(self.gevent_mocked.monkey.patch_socket.called) | ||
self.assertTrue(self.psycogreen_mocked.gevent.patch_psycopg.called) |
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