Пример #1
0
    def test_add_process_override_input_output(self):
        inputs = [
            cwt.wps.data_input_description('new_input', 'new_input',
                                           'text/json', 1, 1)
        ]

        outputs = [
            cwt.wps.process_output_description('new_output', 'new_output',
                                               'text/json')
        ]

        backend = backends.Backend()

        backend.add_process('id',
                            'name', {},
                            abstract='abstract',
                            data_inputs=inputs,
                            process_outputs=outputs)

        self.assertEqual(len(backend.processes), 1)

        description = backend.processes[0]['description']

        self.assertIn('new_input', description)
        self.assertIn('new_output', description)
Пример #2
0
    def test_add_process_duplicate(self):
        backend = backends.Backend()

        with self.assertNumQueries(5):
            backend.add_process('id', 'name')

        with self.assertNumQueries(2):
            backend.add_process('id', 'name')
Пример #3
0
    def test_add_process(self):
        backend = backends.Backend()

        backend.add_process('id', 'name', {}, abstract='abstract')

        self.assertEqual(len(backend.processes), 1)

        description = backend.processes[0]['description']

        self.assertIn('output', description)
        self.assertIn('variable', description)
        self.assertIn('domain', description)
        self.assertIn('operation', description)
Пример #4
0
    def test_add_process(self):
        backend = backends.Backend()

        with self.assertNumQueries(5):
            backend.add_process('id', 'name', 'abstract')
Пример #5
0
    def test_initialize(self):
        backend = backends.Backend()

        backend.initialize()
Пример #6
0
    def test_populate_processes(self):
        backend = backends.Backend()

        with self.assertRaises(NotImplementedError):
            backend.populate_processes()
Пример #7
0
    def test_execute(self):
        backend = backends.Backend()

        with self.assertRaises(NotImplementedError):
            backend.execute('', {}, {}, {})
Пример #8
0
    def test_workflow(self):
        backend = backends.Backend()

        with self.assertRaises(NotImplementedError):
            backend.workflow(None, {}, {}, {})
Пример #9
0
    def test_add_process_without_abstract(self):
        backend = backends.Backend()

        backend.add_process('id', 'name', {})

        self.assertEqual(len(backend.processes), 1)