def test_select_multibuild_package(self): self.wf.setup_rings() staging = self.wf.create_staging('A', freeze=True) project = self.wf.create_project('devel:gcc') package = OBSLocal.Package(name='gcc9', project=project) package.create_commit(filename='gcc9.spec', text='Name: gcc9') package.create_commit(filename='gcc9-tests.spec') package.create_commit( '<multibuild><flavor>gcc9-tests.spec</flavor></multibuild>', filename='_multibuild') self.wf.submit_package(package) ret = SelectCommand(self.wf.api, staging.name).perform(['gcc9']) self.assertEqual(True, ret) self.assertEqual(package_list(self.wf.apiurl, staging.name), ['gcc9']) file = source_file_load(self.wf.apiurl, staging.name, 'gcc9', 'gcc9.spec') self.assertEqual(file, 'Name: gcc9') uc = UnselectCommand(self.wf.api) self.assertIsNone(uc.perform(['gcc9'], False, None)) # no stale links self.assertEqual([], package_list(self.wf.apiurl, staging.name))
def test_select_multiple_spec(self): self.wf.setup_rings() staging = self.wf.create_staging('A', freeze=True) project = self.wf.create_project('devel:gcc') package = OBSLocal.Package(name='gcc8', project=project) package.create_commit(filename='gcc8.spec', text='Name: gcc8') package.create_commit(filename='gcc8-tests.spec') self.wf.submit_package(package) ret = SelectCommand(self.wf.api, staging.name).perform(['gcc8']) self.assertEqual(True, ret) self.assertEqual(package_list(self.wf.apiurl, staging.name), ['gcc8', 'gcc8-tests']) file = source_file_load(self.wf.apiurl, staging.name, 'gcc8', 'gcc8.spec') self.assertEqual(file, 'Name: gcc8') # we should see the spec file also in the 2nd package file = source_file_load(self.wf.apiurl, staging.name, 'gcc8-tests', 'gcc8.spec') self.assertEqual(file, 'Name: gcc8') uc = UnselectCommand(self.wf.api) self.assertIsNone(uc.perform(['gcc8'], False, None)) # no stale links self.assertEqual([], package_list(self.wf.apiurl, staging.name))
def test_select_multiple_spec(self): self.wf.setup_rings() staging = self.wf.create_staging('A', freeze=True) project = self.wf.create_project('devel:gcc') package = OBSLocal.Package(name='gcc8', project=project) package.create_commit(filename='gcc8.spec') package.create_commit(filename='gcc8-tests.spec') self.wf.submit_package(package) ret = SelectCommand(self.wf.api, staging.name).perform(['gcc8']) self.assertEqual(True, ret) self.assertEqual(package_list(self.wf.apiurl, staging.name), ['gcc8', 'gcc8-tests']) uc = UnselectCommand(self.wf.api) self.assertIsNone(uc.perform(['gcc8'])) # no stale links self.assertEqual([], package_list(self.wf.apiurl, staging.name))