def testFetchFakePackages(self): """Pretend to fetch binary packages.""" gs_mock = self.StartPatcher(gs_unittest.GSContextMock()) gs_mock.SetDefaultCmdResult() uri = 'gs://foo/bar' packages_uri = '{}/Packages'.format(uri) packages_file = '''URI: gs://foo CPV: boo/baz PATH boo/baz.tbz2 ''' gs_mock.AddCmdResult(['cat', packages_uri], output=packages_file) binpkg.FetchTarballs([uri], self.tempdir)
def testFetchRealPackages(self): """Actually fetch a real binhost from the network.""" uri = 'gs://chromeos-prebuilt/board/lumpy/paladin-R37-5905.0.0-rc2/packages' binpkg.FetchTarballs([uri], self.tempdir)