-
Notifications
You must be signed in to change notification settings - Fork 101
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 #169 from enthought/fix-datasource
Fix UnboundLocalError when a datasource of the wrong shape is looked for
- Loading branch information
Showing
3 changed files
with
50 additions
and
28 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,22 @@ | ||
import unittest | ||
|
||
from numpy import arange | ||
|
||
# Chaco imports | ||
from chaco.api import ArrayPlotData, Plot | ||
|
||
|
||
class PlotTestCase(unittest.TestCase): | ||
|
||
def test_plot_from_unsupported_array_shape(self): | ||
arr = arange(8).reshape(2, 2, 2) | ||
data = ArrayPlotData(x=arr, y=arr) | ||
plot = Plot(data) | ||
self.assertRaises(ValueError, plot.plot, ("x", "y")) | ||
|
||
arr = arange(16).reshape(2, 2, 2, 2) | ||
data.update_data(x=arr, y=arr) | ||
self.assertRaises(ValueError, plot.plot, ("x", "y")) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
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