Ejemplo n.º 1
0
    def setup_class(cls):



        # Start mock EC API
        harvest_model.setup()
        run_mock_ec()
Ejemplo n.º 2
0
    def setup_class(cls):
        harvest_model.setup()
        CreateTestData.create()

        sysadmin_user = ckan.model.User.get('testsysadmin')
        cls.sysadmin = {
                'id': sysadmin_user.id,
                'apikey': sysadmin_user.apikey,
                'name': sysadmin_user.name,
                }


        cls.app = paste.fixture.TestApp(pylons.test.pylonsapp)

        cls.default_source_dict =  {
          "url": "http://test.action.com",
          "name": "test-source-action",
          "title": "Test source action",
          "notes": "Test source action desc",
          "source_type": "test-for-action",
          "frequency": "MANUAL",
          "config": json.dumps({"custom_option":["a","b"]})
        }

        if not p.plugin_loaded('test_action_harvester'):
            p.load('test_action_harvester')
Ejemplo n.º 3
0
 def setup_class(cls):
     '''
     Setup database and variables
     '''
     harvest_model.setup()
     kata_model.setup()
     cls.harvester = OAIPMHHarvester()
    def setup_class(cls):

        helpers.reset_db()
        super(TestController, cls).setup_class()
        harvest_model.setup()
        sysadmin = factories.Sysadmin()
        cls.extra_environ = {'REMOTE_USER': sysadmin['name'].encode('ascii')}
Ejemplo n.º 5
0
    def setup_class(self):
        '''
        Setup database and variables
        '''
        ckan.model.repo.rebuild_db()
        harvest_model.setup()
        kata_model.setup()

        self.ddi_harvester = dharvester.DDIHarvester()
Ejemplo n.º 6
0
    def setup_class(cls):
        '''
        Setup database and variables
        '''
        ckan.model.repo.rebuild_db()
        harvest_model.setup()
        kata_model.setup()

        cls.ddi_converter = dconverter.DataConverter()

        # cls.ddi_xml = testdata.nr1
        cls.ddi_xml = bs4.BeautifulSoup(testdata.nr1, 'xml')
Ejemplo n.º 7
0
    def setup_class(cls):
        '''
        Setup database
        '''
        model.repo.rebuild_db()
        harvest_model.setup()
        kata_model.setup()

        # The Pylons globals are not available outside a request. This is a hack to provide context object.
        c = AttribSafeContextObj()
        py_obj = PylonsContext()
        py_obj.tmpl_context = c
        pylons.tmpl_context._push_object(c)
Ejemplo n.º 8
0
 def setup_class(self):
     username = u'testlogin2'
     password = u'letmein'
     CreateTestData.create_user(name=username,
                                password=password)
     # do the login
     offset = url_for(controller='user', action='login')
     res = self.app.get(offset)
     fv = res.forms['login']
     fv['login'] = str(username)
     fv['password'] = str(password)
     fv['remember'] = True
     res = fv.submit()
     setup()
Ejemplo n.º 9
0
    def setup_class(cls):
        super(HarvestSourceActionBase, cls).setup_class()
        harvest_model.setup()

        if not p.plugin_loaded('test_action_harvester'):
            p.load('test_action_harvester')
Ejemplo n.º 10
0
 def setup_class(cls):
     """
     Remove any initial sessions.
     """
     Session.remove()
     package_dicts = [{'name':u'abraham', 'title':u'Abraham'},
             {'name':u'homer', 'title':u'Homer', 'tags':['foo', 'bar',
                                                         'baz']},
             {'name':u'homer_derived', 'title':u'Homer Derived'},
             {'name':u'beer', 'title':u'Beer'},
             {'name':u'bart', 'title':u'Bart'},
             {'name':u'lisa', 'title':u'Lisa', 'extras': {'fezina':'foo'}},
             {'name':u'marge', 'title':u'Marge'},
             {'name':u'marge1', 'title':u'Marge'},
             {'name':u'marge11', 'title':u'Marge'},
             {'name':u'marge121', 'title':u'Marge'},
             {'name':u'marge311', 'title':u'Marge'},
             {'name':u'marge24', 'title':u'Marge'},
             {'name':u'marget1', 'title':u'Marge'},
             {'name':u'marge31', 'title':u'Marge'},
             {'name':u'marge1121', 'title':u'Marge'},
             {'name':u'marge1t', 'title':u'Marge'},
             {'name':u'marge1b', 'title':u'Marge'},
             {'name':u'marge1a', 'title':u'Marge'},
             ]
     CreateTestData.create_arbitrary(package_dicts)
     package_dicts = [u'abraham',
             u'homer',
             u'homer_derived',
             u'beer',
             u'bart',
             u'lisa',
             u'marge',
             u'marge1',
             u'marge11',
             u'marge121',
             u'marge311',
             u'marge24',
             u'marget1',
             u'marge31',
             u'marge1121',
             u'marge1t',
             u'marge1b',
             u'marge1a',
             ]
     group_dicts = [{'name':'roger', 'title':'roger', 'description':'',
                     'packages': package_dicts},
                    {'name':'roger1', 'title':'roger', 'description':''},
                    {'name':'roger2', 'title':'roger', 'description':''},
                    {'name':'roger3', 'title':'roger', 'description':''},
                    {'name':'roger4', 'title':'roger', 'description':''},
                    {'name':'roger5', 'title':'roger', 'description':''},
                    {'name':'roger6', 'title':'roger', 'description':''},
                    {'name':'roger7', 'title':'roger', 'description':''},
                    {'name':'roger8', 'title':'roger', 'description':''},
                    {'name':'roger9', 'title':'roger', 'description':''},
                    {'name':'roger0', 'title':'roger', 'description':''},
                    {'name':'roger11', 'title':'roger', 'description':''},
                    {'name':'roger12', 'title':'roger', 'description':''},
                    {'name':'roger13', 'title':'roger', 'description':''},
                    {'name':'roger14', 'title':'roger', 'description':''}]
     CreateTestData.create_groups(group_dicts)
     setup()
     cls._first = True
     cls._second = False
Ejemplo n.º 11
0
 def setup(self):
     helpers.reset_db()
     harvest_model.setup()
Ejemplo n.º 12
0
 def setup_class(cls):
     helpers.reset_db()
     harvest_model.setup()
Ejemplo n.º 13
0
 def setup_class(cls):
     super(TestHarvestErrorMail, cls).setup_class()
     reset_db()
     harvest_model.setup()
Ejemplo n.º 14
0
 def setup(self):
     reset_db()
     harvest_model.setup()
Ejemplo n.º 15
0
 def setup_class(cls):
     reset_db()
     harvest_model.setup()
Ejemplo n.º 16
0
    def setup(self):

        harvest_model.setup()

        self.gather_consumer.queue_purge(queue='ckan.harvest.gather.test')
        self.fetch_consumer.queue_purge(queue='ckan.harvest.fetch.test')
Ejemplo n.º 17
0
 def setup_class(cls):
     '''Set up testing environment.'''
     kata_model.setup()
     harvest_model.setup()
Ejemplo n.º 18
0
 def setup_class(cls):
     '''Set up testing environment.'''
     kata_model.setup()
     harvest_model.setup()
     CreateTestData.create()
Ejemplo n.º 19
0
 def setup_class(cls):
     super(TestHarvestErrorMail, cls).setup_class()
     reset_db()
     harvest_model.setup()
Ejemplo n.º 20
0
 def setup_class(cls):
     '''
     Setup database
     '''
     harvest_model.setup()
     kata_model.setup()
Ejemplo n.º 21
0
 def setup_class(cls):
     harvest_model.setup()
Ejemplo n.º 22
0
    def setup_class(cls):
        super(HarvestSourceActionBase, cls).setup_class()
        harvest_model.setup()

        if not p.plugin_loaded('test_action_harvester'):
            p.load('test_action_harvester')
Ejemplo n.º 23
0
    def setup_class(cls):
        kata_model.setup()
        harvest_model.setup()

        model.User(name="test_sysadmin", sysadmin=True).save()
Ejemplo n.º 24
0
 def setUpClass(cls):
     harvest_model.setup()
     kata_model.setup()
Ejemplo n.º 25
0
 def setup(self):
     reset_db()
     harvest_model.setup()
Ejemplo n.º 26
0
    def setup(self):

        harvest_model.setup()

        queue.purge_queues()
Ejemplo n.º 27
0
 def setup_class(cls):
     reset_db()
     harvest_model.setup()
 def setup_class(self):
     CreateTestData.create()
     setup()