Release 0.4.2
[rebuildd/rebuildd.git] / tests / RebuilddTestSetup.py
1 from rebuildd.RebuilddConfig import RebuilddConfig
2 from rebuildd.Rebuildd import Rebuildd
3 from rebuildd.Package import Package
4 from rebuildd.Job import Job
5 import os
6
7 def rebuildd_global_test_setup():
8         RebuilddConfig(dontparse=True)
9         RebuilddConfig().set('log', 'logs_dir', '/tmp')
10         RebuilddConfig().set('build', 'database_uri', 'sqlite:///tmp/rebuildd-tests.db')
11         RebuilddConfig().set('build', 'max_jobs', '100')
12         RebuilddConfig().set('log', 'file', '/dev/null')
13         RebuilddConfig().set('log', 'mail_failed', '0')
14         RebuilddConfig().set('build', 'build_more_recent', '0') 
15         RebuilddConfig().set('log', 'mail_successful', '0')
16         RebuilddConfig().arch = ["alpha", "any"]
17         try:
18             os.unlink("/tmp/rebuildd-tests.db")
19         except OSError:
20             pass
21         Rebuildd()
22         try:
23             Package.createTable()
24             Job.createTable()
25         except:
26              pass