예제 #1
0
	def setUp(self):
		set_spring_dir(self.test_dir)

		# Speed up the test because if pool is present the 256 pool
		# directories are created on demand instead of beforehand.
		mkdir_p(rapid.pool_dir)

		if True:   # False to use real Downloader, True to use MockDownloader
			self.downloader = MockDownloader()
			self.rapid = Rapid(self.downloader)
			www = self.downloader.www
			www[master_url] = gzip_string(',http://ts1,,\n')
			# The last two packages have an identical name. This should not
			# actually happen in practice (leaves no good way to normalize
			# versions.gz), though it did happen once. (#9)
			# So it's present here to test that rapid handles it properly.
			www['http://ts1/versions.gz'] = gzip_string('xta:latest,1234,dependency,XTA 9.6\n,5678,,dependency\n,90AB,,dependency\n')
			www['http://ts1/packages/1234.sdp'] = gzip_string('\3foo' + binascii.unhexlify('d41d8cd98f00b204e9800998ecf8427e') + 8 * '\0')
			www['http://ts1/packages/5678.sdp'] = gzip_string('')
			www['http://ts1/packages/90AB.sdp'] = gzip_string('')
			www['http://ts1/streamer.cgi?1234'] = struct.pack('>L', len(gzip_string(''))) + gzip_string('')
		else:
			self.downloader = Downloader()
			self.rapid = Rapid(self.downloader)
예제 #2
0
	def setUp(self):
		set_spring_dir(self.test_dir)
		mkdir_p(rapid.content_dir)
		self.pt = PinnedTags()