Skip to content

Commit

Permalink
Added test to create process group inside another process group. (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoti-arora1991 authored and Chaffelson committed Jan 31, 2019
1 parent 7c59c02 commit 9a48503
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
test_host = 'localhost'
test_basename = "nipyapi_test"
test_pg_name = test_basename + "_ProcessGroup"
test_another_pg_name = test_basename + "_AnotherProcessGroup"
test_registry_client_name = test_basename + "_reg_client"
test_processor_name = test_basename + "_proc"
test_bucket_name = test_basename + "_bucket"
Expand Down
10 changes: 10 additions & 0 deletions tests/test_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ def test_create_process_group(regress_nifi):
assert r.position.x == r.position.y == 400
assert r.component.parent_group_id == canvas.get_root_pg_id()
assert isinstance(r, nifi.ProcessGroupEntity)

# Test process group creation on other than root process group.
s = canvas.create_process_group(parent_pg=canvas.get_process_group(conftest.test_pg_name), location=(200.0, 200.0),
new_pg_name=conftest.test_another_pg_name)
assert s.component.name == conftest.test_another_pg_name
assert s.position.x == s.position.y == 200
assert s.component.parent_group_id == canvas.get_process_group(conftest.test_pg_name, "name").id
assert isinstance(s, nifi.ProcessGroupEntity)


with pytest.raises(ApiException):
parent_pg = canvas.get_process_group('NiFi Flow')
parent_pg.id = 'invalid'
Expand Down

0 comments on commit 9a48503

Please sign in to comment.