File: RebuilddTestSetup.py

package info (click to toggle)
rebuildd 0.3.4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 240 kB
  • ctags: 180
  • sloc: python: 1,406; sh: 189; xml: 189; makefile: 27
file content (26 lines) | stat: -rw-r--r-- 961 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from rebuildd.RebuilddConfig import RebuilddConfig
from rebuildd.Rebuildd import Rebuildd
from rebuildd.Package import Package
from rebuildd.Job import Job
import os

def rebuildd_global_test_setup():
        RebuilddConfig(dontparse=True)
        RebuilddConfig().set('log', 'logs_dir', '/tmp')
        RebuilddConfig().set('build', 'database_uri', 'sqlite:///tmp/rebuildd-tests.db')
        RebuilddConfig().set('build', 'max_jobs', '100')
        RebuilddConfig().set('log', 'file', '/dev/null')
        RebuilddConfig().set('log', 'mail_failed', '0')
        RebuilddConfig().set('build', 'build_more_recent', '0') 
        RebuilddConfig().set('log', 'mail_successful', '0')
        RebuilddConfig().arch = ["alpha", "any"]
        try:
            os.unlink("/tmp/rebuildd-tests.db")
        except OSError:
            pass
        Rebuildd()
        try:
            Package.createTable()
            Job.createTable()
        except:
             pass