-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksandar Jovanov
committed
Nov 18, 2019
1 parent
c85a016
commit 6d8e64e
Showing
8 changed files
with
116 additions
and
15 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,11 @@ | ||
DEFAULT_COLORS = [ | ||
'#332288', | ||
'#117733', | ||
'#44aa99', | ||
'#88ccee', | ||
'#ddcc77', | ||
'#cc6677', | ||
'#aa4499', | ||
'#882255', | ||
'#dd4444' | ||
] |
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
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,30 @@ | ||
from ckan import plugins as p | ||
from ckan.tests import helpers as core_helpers | ||
|
||
from ckanext.visualize.default_color_palette import DEFAULT_COLORS | ||
from ckanext.visualize import helpers as extension_helpers | ||
|
||
|
||
class TestHelpers(core_helpers.FunctionalTestBase): | ||
|
||
@classmethod | ||
def setup_class(self): | ||
super(TestHelpers, self).setup_class() | ||
|
||
if not p.plugin_loaded('visualize'): | ||
p.load('visualize') | ||
|
||
@classmethod | ||
def teardown_class(self): | ||
super(TestHelpers, self).teardown_class() | ||
|
||
p.unload('visualize') | ||
|
||
core_helpers.reset_db() | ||
|
||
def test_get_color_palette(self): | ||
assert extension_helpers.get_color_palette() == DEFAULT_COLORS | ||
|
||
@core_helpers.change_config('visualize_colors', '[{"color_1":"#fff"}]') | ||
def test_get_color_palette_from_config(self): | ||
assert extension_helpers.get_color_palette() == ['#fff'] |