|
|
@@ -880,15 +880,29 @@ class TestEditor:
|
|
|
coord = create_coordinator(self.wf)
|
|
|
create_dataset(coord)
|
|
|
|
|
|
- response = self.c.post(reverse('oozie:create_coordinator_data', args=[coord.id, 'input']),
|
|
|
- {u'input-name': [u'input_dir'], u'input-dataset': [u'1']})
|
|
|
- data = json.loads(response.content)
|
|
|
- assert_equal(0, data['status'], data['data'])
|
|
|
+ create_coordinator_data(coord)
|
|
|
+
|
|
|
|
|
|
def test_setup_app(self):
|
|
|
self.c.post(reverse('oozie:setup_app'))
|
|
|
|
|
|
|
|
|
+ def test_get_workflow_parameters(self):
|
|
|
+ assert_equal([{'name': u'output', 'value': ''}, {'name': u'SLEEP', 'value': ''}, {'name': u'market', 'value': u'US'}],
|
|
|
+ self.wf.find_all_parameters())
|
|
|
+
|
|
|
+
|
|
|
+ def test_get_coordinator_parameters(self):
|
|
|
+ coord = create_coordinator(self.wf)
|
|
|
+
|
|
|
+ create_dataset(coord)
|
|
|
+ create_coordinator_data(coord)
|
|
|
+
|
|
|
+ assert_equal([{'name': u'output', 'value': ''}, {'name': u'SLEEP', 'value': ''}, {'name': u'market', 'value': u'US,France'},
|
|
|
+ {'name': u'input_dir', 'value': 'MyDataset [dataset]'}],
|
|
|
+ coord.find_all_parameters())
|
|
|
+
|
|
|
+
|
|
|
# Utils
|
|
|
WORKFLOW_DICT = {u'deployment_dir': [u''], u'name': [u'wf-name-1'], u'description': [u''],
|
|
|
u'schema_version': [u'uri:oozie:workflow:0.2'],
|
|
|
@@ -921,6 +935,7 @@ def create_workflow():
|
|
|
|
|
|
wf = Workflow.objects.get()
|
|
|
assert_not_equal('', wf.deployment_dir)
|
|
|
+ # TODO test for existence on HDFS
|
|
|
|
|
|
action1 = add_action(wf.id, wf.start.id, 'action-name-1')
|
|
|
action2 = add_action(wf.id, action1.id, 'action-name-2')
|
|
|
@@ -969,6 +984,15 @@ def create_dataset(coord):
|
|
|
assert_equal(0, data['status'], data['data'])
|
|
|
|
|
|
|
|
|
+def create_coordinator_data(coord):
|
|
|
+ c = make_logged_in_client()
|
|
|
+
|
|
|
+ response = c.post(reverse('oozie:create_coordinator_data', args=[coord.id, 'input']),
|
|
|
+ {u'input-name': [u'input_dir'], u'input-dataset': [u'1']})
|
|
|
+ data = json.loads(response.content)
|
|
|
+ assert_equal(0, data['status'], data['data'])
|
|
|
+
|
|
|
+
|
|
|
def move(c, wf, direction, action):
|
|
|
try:
|
|
|
LOG.info(wf.get_hierarchy())
|