build.tests.test_config   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 21
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A TestDevelopmentConfig.test_app_is_development() 0 3 1
A TestProductionConfig.test_app_is_production() 0 3 1
A TestTestingConfig.test_app_is_testing() 0 4 1
1
import os
2
import pytest
3
4
from unittest import TestCase
5
from run import create_app
6
7
8
class TestTestingConfig(TestCase):
9
    app = create_app("testing")
10
    
11
    def test_app_is_testing(self):
12
        self.assertTrue(self.app.config['DEBUG'] is True)
13
        self.assertTrue(self.app.config['TESTING'] is True)
14
        self.assertTrue(self.app.config['DATABASE_URL'] == "postgresql://antonio:pass.123@localhost/test_db")
15
16
17
class TestDevelopmentConfig(TestCase):
18
    app = create_app("development")
19
    
20
    def test_app_is_development(self):
21
        self.assertTrue(self.app.config['DEBUG'] is True)
22
        self.assertTrue(self.app.config['DATABASE_URL'] == "postgresql://antonio:pass.123@localhost/mtracker_db")
23
    
24
25
26
class TestProductionConfig(TestCase):
27
    app = create_app("production")
28
    
29
    def test_app_is_production(self):
30
        self.assertTrue(self.app.config['DEBUG'] is False)
31
        self.assertTrue(self.app.config['TESTING'] is False)