Example #1
0
    def test_patch_all(self):
        with patch("onaplogging.monkey.patch_logging_mdc") as mock_mdc:
            with patch("onaplogging.monkey.patch_logging_yaml") as mock_yaml:
                patch_all()
                mock_mdc.assert_called_once()
                mock_yaml.assert_called_once()

        with patch("onaplogging.monkey.patch_logging_mdc") as mock_mdc:
            with patch("onaplogging.monkey.patch_logging_yaml") as mock_yaml:
                patch_all(mdc=False)
                mock_mdc.assert_not_called()
                mock_yaml.assert_called_once()

        with patch("onaplogging.monkey.patch_logging_mdc") as mock_mdc:
            with patch("onaplogging.monkey.patch_logging_yaml") as mock_yaml:
                patch_all(yaml=False)
                mock_mdc.assert_called_once()
                mock_yaml.assert_not_called()

        with patch("onaplogging.monkey.patch_logging_mdc") as mock_mdc:
            with patch("onaplogging.monkey.patch_logging_yaml") as mock_yaml:
                patch_all(mdc=False, yaml=False)
                mock_mdc.assert_not_called()
                mock_yaml.assert_not_called()
Example #2
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import sys
import platform

import lcm.pub.redisco

from lcm.pub.config.config import REDIS_HOST, REDIS_PORT, REDIS_PASSWD
from lcm.pub.config.config import DB_NAME, DB_IP, DB_USER, DB_PASSWD, DB_PORT
from logging import config
from onaplogging import monkey
monkey.patch_all()

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '3o-wney!99y)^h3v)0$j16l9=fdjxcb+a8g+q3tfbahcnu2b0o'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']