<commit_before># -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals

import os
import unittest
from app import create_app


class ConfigTestCase(unittest.TestCase):

    def test_prod_config(self):
        os.environ["FLASK_CONFIGURATION"] = "prod"
        os.environ["S3_BUCKET_NAME"] = "test_bucket"
        os.environ["AWS_REGION"] = "us-west-2"
        os.environ["AWS_ACCESS_KEY_ID"] = "access"
        os.environ["AWS_SECRET_ACCESS_KEY"] = "secret"
        os.environ["GITHUB_CLIENT_ID"] = "client_id"
        os.environ["GITHUB_CLIENT_SECRET"] = "client_secret"
        os.environ["SQLALCHEMY_DATABASE_URI"] = "postgresql://@localhost:5432/dpr_db"

        app = create_app()
        self.assertEqual(False, app.config['TESTING'])
        self.assertEqual(False, app.config['DEBUG'])
        self.assertEqual("us-west-2", app.config['AWS_REGION'])

    def test_development_config(self):
        os.environ["FLASK_CONFIGURATION"] = "development"

        os.environ["S3_BUCKET_NAME"] = "test_bucket"
        os.environ["AWS_REGION"] = "us-west-2"
        os.environ["AWS_ACCESS_KEY_ID"] = "access"
        os.environ["AWS_SECRET_ACCESS_KEY"] = "secret"
        os.environ["GITHUB_CLIENT_ID"] = "client_id"
        os.environ["GITHUB_CLIENT_SECRET"] = "client_secret"
        os.environ["SQLALCHEMY_DATABASE_URI"] = "postgresql://@localhost:5432/dpr_db"

        app = create_app()
        self.assertEqual(True, app.config['TESTING'])
        self.assertEqual(True, app.config['DEBUG'])<commit_msg>[xs] fix failing test in ConfigTestCase refs - # 311<commit_after># -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals

import os
import unittest
from app import create_app


class ConfigTestCase(unittest.TestCase):

    def test_prod_config(self):
        os.environ["FLASK_CONFIGURATION"] = "prod"
        os.environ["S3_BUCKET_NAME"] = "test_bucket"
        os.environ["AWS_REGION"] = "us-west-2"
        os.environ["AWS_ACCESS_KEY_ID"] = "access"
        os.environ["AWS_SECRET_ACCESS_KEY"] = "secret"
        os.environ["GITHUB_CLIENT_ID"] = "client_id"
        os.environ["GITHUB_CLIENT_SECRET"] = "client_secret"
        os.environ["SQLALCHEMY_DATABASE_URI"] = "postgresql://@localhost:5432/dpr_db"

        app = create_app()
        self.assertEqual(False, app.config['TESTING'])
        self.assertEqual(False, app.config['DEBUG'])
        self.assertEqual("us-west-2", app.config['AWS_REGION'])

    def test_development_config(self):
        os.environ["FLASK_CONFIGURATION"] = "development"

        os.environ["S3_BUCKET_NAME"] = "test_bucket"
        os.environ["AWS_REGION"] = "us-west-2"
        os.environ["AWS_ACCESS_KEY_ID"] = "access"
        os.environ["AWS_SECRET_ACCESS_KEY"] = "secret"
        os.environ["GITHUB_CLIENT_ID"] = "client_id"
        os.environ["GITHUB_CLIENT_SECRET"] = "client_secret"
        os.environ["SQLALCHEMY_DATABASE_URI"] = "postgresql://@localhost:5432/dpr_db"

        app = create_app()
        self.assertEqual(True, app.config['TESTING'])
        self.assertEqual(True, app.config['DEBUG'])

    def tearDown(self):
        os.environ["FLASK_CONFIGURATION"] = "test"
{'fraction_non_alphanumeric': 0.13580980683506685, 'fraction_numerical': 0.009212481426448737, 'mean_word_length': 3.7142857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3669906', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1164, 'n_words': 168}