-
Notifications
You must be signed in to change notification settings - Fork 159
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 #372 from Qblack/feature/blueprint_dropdown
Adding the ability to filter by 'blueprint' first word before .
- Loading branch information
Showing
6 changed files
with
62 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def get_blueprint(endpoint_name): | ||
blueprint = endpoint_name | ||
if '.' in endpoint_name: | ||
blueprint = endpoint_name.split('.')[0] | ||
return blueprint |
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,28 @@ | ||
import pytest | ||
|
||
from flask_monitoringdashboard.core.blueprints import get_blueprint | ||
|
||
|
||
@pytest.mark.parametrize('name', ['Fiddler']) | ||
def test_get_blueprint(name): | ||
actual = get_blueprint(name) | ||
assert actual == 'Fiddler' | ||
|
||
|
||
@pytest.mark.parametrize('name', ['Anomander.Purake']) | ||
def test_get_blueprint_double_gives_first(name): | ||
actual = get_blueprint(name) | ||
assert actual == 'Anomander' | ||
|
||
|
||
@pytest.mark.parametrize('name', ['Karsa.Orlong.Toblakai']) | ||
def test_get_blueprint_triple_gives_first(name): | ||
actual = get_blueprint(name) | ||
assert actual == 'Karsa' | ||
|
||
|
||
@pytest.mark.usefixtures('request_context') | ||
@pytest.mark.parametrize('name', ['']) | ||
def test_get_blueprint_blank_gives_blank(name): | ||
actual = get_blueprint(name) | ||
assert actual == '' |