comparison test/test_info.py @ 392:e2afbd3c2bf1 treepkg-status

write first info about tracks
author Bjoern Ricks <bricks@intevation.de>
date Thu, 08 Jul 2010 16:11:13 +0000
parents 1af04bfbb1d0
children 94a6ae627b31
comparison
equal deleted inserted replaced
391:89ecca5d262e 392:e2afbd3c2bf1
12 import sys 12 import sys
13 13
14 test_dir = os.path.dirname(__file__) 14 test_dir = os.path.dirname(__file__)
15 sys.path.append(os.path.join(test_dir, os.pardir)) 15 sys.path.append(os.path.join(test_dir, os.pardir))
16 16
17 from treepkg.info.status import TreepkgInfo 17 from treepkg.info.status import *
18 from treepkg.report import get_packager_group 18 from treepkg.report import get_packager_group
19 from filesupport import FileTestMixin 19 from filesupport import FileTestMixin
20 20
21 class TreepkgInfoExampleTest(unittest.TestCase, FileTestMixin): 21 class TreepkgInfoTest(unittest.TestCase, FileTestMixin):
22 config_contents = """\ 22 config_contents = """\
23 [DEFAULT] 23 [DEFAULT]
24 treepkg_dir: /home/builder/mill 24 #treepkg_dir: /home/builder/mill
25 tracks_dir: %(treepkg_dir)s/tracks 25 #tracks_dir: %(treepkg_dir)s/tracks
26 tracks_dir: /home/builder/mill/tracks
26 root_cmd: sudo 27 root_cmd: sudo
27 pbuilder_dir: %(treepkg_dir)s/pbuilder 28 pbuilder_dir: %(tracks_dir)s/pbuilder
28 builderconfig: %(pbuilder_dir)s/pbuilderrc 29 builderconfig: %(pbuilder_dir)s/pbuilderrc
29 deb_email: treepkg@example.com 30 deb_email: treepkg@example.com
30 deb_fullname: TreePKG 31 deb_fullname: TreePKG
31 pkg_revision_template: treepkg%%(pkg_revision)s 32 pkg_revision_template: treepkg%%(pkg_revision)s
32 handle_dependencies: False 33 handle_dependencies: False
33 34
34 [treepkg] 35 [treepkg]
35 instructions_file: %(treepkg_dir)s/instructions 36 instructions_file: %(tracks_dir)s/instructions
36 check_interval: 3600 37 check_interval: 3600
37 name: testtreepkginfo 38 name: testtreepkginfo
38 39
39 [pkg_simple] 40 [pkg_simple]
40 pkg_basename: simple1 41 pkg_basename: simple1
65 def tearDown(self): 66 def tearDown(self):
66 sys.path = self.old_path 67 sys.path = self.old_path
67 68
68 def test_createinfo(self): 69 def test_createinfo(self):
69 config_file = os.path.join(self.directory, "treepkg.cfg") 70 config_file = os.path.join(self.directory, "treepkg.cfg")
70 group = get_packager_group(config_file) 71 tpkginfo = TreepkgInfo(config_file)
71 tpginfo = TreepkgInfo(group.name) 72 print tpkginfo.toxml().toxml()
72 print tpginfo.toxml().toxml() 73 tpkgroot = tpkginfo.tpkgroot
73 self.assertEquals("testtreepkginfo", tpginfo.name) 74 self.assertEquals("testtreepkginfo", tpkgroot.name)
74 75
75 76
76 class TreepkgInfoTest(unittest.TestCase): 77 class TreepkgRootInfoTest(unittest.TestCase):
77 78
78 def test_toxml(self): 79 def test_toxml(self):
79 status = TreepkgInfo("testtreepkg") 80 status = TreepkgRootInfo("testtreepkg")
80 dom = status.toxml() 81 dom = status.toxml()
81 xml = dom.toxml() 82 xml = dom.toxml()
82 self.assertEquals("<status><name>testtreepkg</name></status>", xml) 83 self.assertEquals("<status><name>testtreepkg</name></status>", xml)
83 84
84 if __name__ == '__main__': 85 if __name__ == '__main__':
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)