def test_get_repository_filter_raw(self): """Test whether the repository filter raw works properly""" expected_filter = { 'name': 'origin', 'value': 'http://example.com' } eitems = ElasticItems(self.perceval_backend) fltr = eitems.get_repository_filter_raw() self.assertDictEqual(fltr, expected_filter) expected_filter = { 'name': 'tag', 'value': 'test' } perceval_backend_meetup = Meetup('mygroup', 'aaaa', tag='test') eitems = MeetupOcean(perceval_backend_meetup) fltr = eitems.get_repository_filter_raw() self.assertDictEqual(fltr, expected_filter) expected_filter = {} perceval_backend_meetup = Meetup('mygroup', 'aaaa', tag='https://meetup.com/') eitems = MeetupOcean(perceval_backend_meetup) fltr = eitems.get_repository_filter_raw() self.assertDictEqual(fltr, expected_filter)
def test_arthur_params(self): """Test the extraction of arthur params from an URL""" url = "South-East-Puppet-User-Group" expected_params = {'group': 'South-East-Puppet-User-Group'} self.assertDictEqual(MeetupOcean.get_arthur_params_from_url(url), expected_params)
def test_arthur_params(self): """Test the extraction of arthur params from an URL""" with open("data/projects-release.json") as projects_filename: url = json.load(projects_filename)['grimoire']['meetup'][0] arthur_params = {'group': 'South-East-Puppet-User-Group'} self.assertDictEqual(arthur_params, MeetupOcean.get_arthur_params_from_url(url))
def test_perceval_params(self): """Test the extraction of perceval params from an URL""" url = "South-East-Puppet-User-Group" expected_params = [ "--tag", "South-East-Puppet-User-Group", "South-East-Puppet-User-Group" ] self.assertListEqual(MeetupOcean.get_perceval_params_from_url(url), expected_params)