Passed
Pull Request — master (#133)
by Thijs
01:10
created

pyramid_tut.tests.test_init_db   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 13
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestInitializeDB.test_run() 0 6 1
A TestInitializeDB.test_usage() 0 5 2
1
import os
2
import unittest
3
4
5
class TestInitializeDB(unittest.TestCase):
6
    def test_usage(self):
7
        from ..scripts.initializedb import main
8
9
        with self.assertRaises(SystemExit):
10
            main(argv=["foo"])
11
12
    def test_run(self):
13
        from ..scripts.initializedb import main
14
15
        main(argv=["foo", "development.ini"])
16
        self.assertTrue(os.path.exists("tutorial.sqlite"))
17
        os.remove("tutorial.sqlite")
18