+ def setup_locations(self):
+ 'create some Location objects, TODO: add component'
+
+ if 'loc' in self.__dict__:
+ return
+ self.loc = {}
+ self.loc['main'] = Location(path = \
+ '/srv/ftp-master.debian.org/ftp/pool/')
+ self.loc['contrib'] = Location(path = \
+ '/srv/ftp-master.debian.org/ftp/pool/')
+ self.session.add_all(self.loc.values())
+
+ def setup_poolfiles(self):
+ 'create some PoolFile objects'
+
+ if 'file' in self.__dict__:
+ return
+ self.setup_locations()
+ self.file = {}
+ self.file['hello_2.2-3.dsc'] = PoolFile(filename = 'main/h/hello/hello_2.2-3.dsc', \
+ location = self.loc['main'], filesize = 0, md5sum = '')
+ self.file['hello_2.2-2.dsc'] = PoolFile(filename = 'main/h/hello/hello_2.2-2.dsc', \
+ location = self.loc['main'], filesize = 0, md5sum = '')
+ self.file['hello_2.2-1.dsc'] = PoolFile(filename = 'main/h/hello/hello_2.2-1.dsc', \
+ location = self.loc['main'], filesize = 0, md5sum = '')
+ self.file['hello_2.2-1_i386.deb'] = PoolFile( \
+ filename = 'main/h/hello/hello_2.2-1_i386.deb', \
+ location = self.loc['main'], filesize = 0, md5sum = '')
+ self.file['gnome-hello_2.2-1_i386.deb'] = PoolFile( \
+ filename = 'main/h/hello/gnome-hello_2.2-1_i386.deb', \
+ location = self.loc['main'], filesize = 0, md5sum = '')
+ self.file['sl_3.03-16.dsc'] = PoolFile(filename = 'main/s/sl/sl_3.03-16.dsc', \
+ location = self.loc['main'], filesize = 0, md5sum = '')
+ self.file['python2.6_2.6.6-8.dsc'] = PoolFile( \
+ filename = 'main/p/python2.6/python2.6_2.6.6-8.dsc', \
+ location = self.loc['main'], filesize = 0, md5sum = '')
+ self.session.add_all(self.file.values())
+
+ def setup_maintainers(self):
+ 'create some Maintainer objects'
+
+ if 'maintainer' in self.__dict__:
+ return
+ self.maintainer = {}
+ self.maintainer['maintainer'] = Maintainer(name = 'Mr. Maintainer')
+ self.maintainer['uploader'] = Maintainer(name = 'Mrs. Uploader')
+ self.maintainer['lazyguy'] = Maintainer(name = 'Lazy Guy')
+ self.session.add_all(self.maintainer.values())
+
+ def setup_sources(self):
+ 'create DBSource objects'
+
+ if 'source' in self.__dict__:
+ return
+ self.setup_maintainers()
+ self.setup_suites()
+ self.setup_poolfiles()
+ self.source = {}
+ self.source['hello_2.2-2'] = DBSource(source = 'hello', version = '2.2-2', \
+ maintainer = self.maintainer['maintainer'], \
+ changedby = self.maintainer['uploader'], \
+ poolfile = self.file['hello_2.2-2.dsc'], install_date = self.now())
+ self.source['hello_2.2-2'].suites.append(self.suite['sid'])
+ self.source['hello_2.2-1'] = DBSource(source = 'hello', version = '2.2-1', \
+ maintainer = self.maintainer['maintainer'], \
+ changedby = self.maintainer['uploader'], \
+ poolfile = self.file['hello_2.2-1.dsc'], install_date = self.now())
+ self.source['hello_2.2-1'].suites.append(self.suite['sid'])
+ self.source['sl_3.03-16'] = DBSource(source = 'sl', version = '3.03-16', \
+ maintainer = self.maintainer['maintainer'], \
+ changedby = self.maintainer['uploader'], \
+ poolfile = self.file['sl_3.03-16.dsc'], install_date = self.now())
+ self.source['sl_3.03-16'].suites.append(self.suite['squeeze'])
+ self.source['sl_3.03-16'].suites.append(self.suite['sid'])
+ self.session.add_all(self.source.values())
+
+ def setup_binaries(self):
+ 'create DBBinary objects'
+
+ if 'binary' in self.__dict__:
+ return
+ self.setup_sources()
+ self.setup_architectures()
+ self.binary = {}
+ self.binary['hello_2.2-1_i386'] = DBBinary(package = 'hello', \
+ source = self.source['hello_2.2-1'], version = '2.2-1', \
+ maintainer = self.maintainer['maintainer'], \
+ architecture = self.arch['i386'], \
+ poolfile = self.file['hello_2.2-1_i386.deb'])
+ self.binary['hello_2.2-1_i386'].suites.append(self.suite['squeeze'])
+ self.binary['hello_2.2-1_i386'].suites.append(self.suite['sid'])
+ self.binary['gnome-hello_2.2-1_i386'] = DBBinary(package = 'gnome-hello', \
+ source = self.source['hello_2.2-1'], version = '2.2-1', \
+ maintainer = self.maintainer['maintainer'], \
+ architecture = self.arch['i386'], \
+ poolfile = self.file['gnome-hello_2.2-1_i386.deb'])
+ self.binary['gnome-hello_2.2-1_i386'].suites.append(self.suite['squeeze'])
+ self.binary['gnome-hello_2.2-1_i386'].suites.append(self.suite['sid'])
+ self.session.add_all(self.binary.values())
+