def test_from_repository_info_empty(self): # Given repository_info = BroodRepositoryInfo("https://api.enthought.com", "enthought/free") config = Configuration(use_webservice=False, auth=("nono", "password")) config._store_kind = STORE_KIND_BROOD session = Session.authenticated_from_configuration(config) # When repository = Repository.from_repository_info(session, repository_info) # Then self.assertEqual(len(repository), 0)
def test_from_repository_infos_nonempty(self): # Given repository_infos = ( BroodRepositoryInfo("https://api.enthought.com", "enthought/free"), BroodRepositoryInfo( "https://api.enthought.com", "enthought/commercial" ), ) config = Configuration(use_webservice=False, auth=("nono", "password")) config._store_kind = STORE_KIND_BROOD session = Session.authenticated_from_configuration(config) # When repository = Repository.from_repository_infos(session, repository_infos) # Then self.assertEqual(len(repository), 2) self.assertEqual(len(repository.find_packages("nose")), 2)