-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bbc/show_inside_bin_elements
Show inside bin elements in element debug view
- Loading branch information
Showing
5 changed files
with
82 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import time, pytest | ||
from utils import * | ||
|
||
|
||
def test_elements_api_endpoint(run_brave): | ||
''' | ||
Check that /api/elements returns a list of element details, | ||
including when "?show_inside_bin_elements=yes" | ||
''' | ||
run_brave() | ||
time.sleep(0.5) | ||
check_brave_is_running() | ||
add_input({'type': 'image', 'props': {'uri': 'file://' + test_directory() + '/assets/image_640_360.png'}}) | ||
time.sleep(1) | ||
|
||
subtest_elements_endpoint() | ||
subtest_elements_endpoint_with_bin_elements() | ||
|
||
def subtest_elements_endpoint(): | ||
elements_response = api_get('/api/elements') | ||
assert elements_response.status_code == 200 | ||
elements_object = elements_response.json() | ||
assert len(elements_object['inputs'].items()) == 1 | ||
assert len(elements_object['mixers'].items()) == 1 | ||
assert len(elements_object['outputs'].items()) == 0 | ||
assert len(elements_object['inputs']['0']['elements']) == 5 | ||
|
||
def subtest_elements_endpoint_with_bin_elements(): | ||
elements_response = api_get('/api/elements?show_inside_bin_elements=yes') | ||
assert elements_response.status_code == 200 | ||
elements_object = elements_response.json() | ||
assert len(elements_object['inputs'].items()) == 1 | ||
assert len(elements_object['mixers'].items()) == 1 | ||
assert len(elements_object['outputs'].items()) == 0 | ||
assert len(elements_object['inputs']['0']['elements']) == 10 |