def test_project1(self): """get a remote project""" prj = RemoteProject.find('foo') self.assertEqual(prj.title, 'just a dummy title') self.assertEqual(prj.description, 'This is a detailed and more' ' lengthy\ndescription of the foo' '\nproject.') self.assertEqual(prj.repository.get('name'), 'openSUSE_Factory') self.assertEqual(prj.repository.path.get('project'), 'openSUSE:Factory') self.assertEqual(prj.repository.path.get('repository'), 'standard') self.assertEqual(prj.repository.arch[:], ['x86_64', 'i586']) self.assertEqual(prj.person[0].get('userid'), 'testuser') self.assertEqual(prj.person[0].get('role'), 'maintainer') self.assertEqual(prj.person[1].get('userid'), 'foobar') self.assertEqual(prj.person[1].get('role'), 'bugowner')
def test_project3(self): """get, modify, store remote project""" prj = RemoteProject.find('foo') # delete maintainer del prj.person[0] # delete arch i586 del prj.repository.arch[1] # add additional repo (this time <arch /> first then <path />) repo = prj.add_repository(name='openSUSE_11.4') repo.add_arch('i586') repo.add_path(project='openSUSE:11.4', repository='standard') # modify title prj.title = 'new title' # add + remove illegal tag prj.something = 'oops' del prj.something prj.store()
def test_project1(self): """get a remote project""" prj = RemoteProject.find('foo') self.assertEqual(prj.title, 'just a dummy title') self.assertEqual( prj.description, 'This is a detailed and more' ' lengthy\ndescription of the foo' '\nproject.') self.assertEqual(prj.repository.get('name'), 'openSUSE_Factory') self.assertEqual(prj.repository.path.get('project'), 'openSUSE:Factory') self.assertEqual(prj.repository.path.get('repository'), 'standard') self.assertEqual(prj.repository.arch[:], ['x86_64', 'i586']) self.assertEqual(prj.person[0].get('userid'), 'testuser') self.assertEqual(prj.person[0].get('role'), 'maintainer') self.assertEqual(prj.person[1].get('userid'), 'foobar') self.assertEqual(prj.person[1].get('role'), 'bugowner')
def test_project4(self): """test project validation""" RemoteProject.SCHEMA = self.fixture_file('project_simple.xsd') prj = RemoteProject.find('test') prj.person.set('userid', 'bar') prj.store()