Exemple #1
0
def test_Square():
    marker = Square()
    assert marker.angle == "angle"
    yield check_marker, marker
    yield check_fill, marker
    yield check_line, marker
    yield check_props, marker, ["angle"], MARKER, FILL, LINE
Exemple #2
0
class TestSquare(unittest.TestCase):
    def setUp(self):
        from bokeh.glyphs import Square
        self.test_square = Square()

    def test_expected_properties(self):
        expected_properties = set(['angle'])
        actual_properties = get_prop_set(type(self.test_square))
        self.assertTrue(expected_properties.issubset(actual_properties))

    def test_expected_values(self):
        self.assertEqual(self.test_square.__view_model__,'square')

    def test_to_glyphspec(self):
        self.assertEqual(self.test_square.to_glyphspec(), {'line_color': {'value': 'black'}, 'angle': {'units': 'data', 'field': 'angle'}, 'fill_color': {'value': 'gray'}, 'y': {'units': 'data', 'field': 'y'}, 'x': {'units': 'data', 'field': 'x'}, 'type': 'square', 'size': {'units': 'screen', 'field': None, 'default': 4}})
        self.test_square.angle = 90
        self.assertEqual(self.test_square.to_glyphspec(), {'line_color': {'value': 'black'}, 'angle': {'units': 'data', 'value': 90}, 'fill_color': {'value': 'gray'}, 'y': {'units': 'data', 'field': 'y'}, 'x': {'units': 'data', 'field': 'x'}, 'type': 'square', 'size': {'units': 'screen', 'field': None, 'default': 4}})
Exemple #3
0
class TestSquare(unittest.TestCase):
    def setUp(self):
        from bokeh.glyphs import Square
        self.test_square = Square()

    def test_expected_properties(self):
        expected_properties = set(['angle'])
        actual_properties = get_prop_set(type(self.test_square))
        self.assertTrue(expected_properties.issubset(actual_properties))

    def test_expected_values(self):
        self.assertEqual(self.test_square.__view_model__, 'square')

    def test_to_glyphspec(self):
        expected = dict(GENERIC_MARKER_DICT)
        expected['type'] = 'square'
        expected['angle'] = {'units': 'data', 'field': 'angle'}
        self.assertEqual(self.test_square.to_glyphspec(), expected)
        self.test_square.angle = 90
        expected['angle'] = {'units': 'data', 'value': 90}
        self.assertEqual(self.test_square.to_glyphspec(), expected)
Exemple #4
0
class TestSquare(unittest.TestCase):

    def setUp(self):
        from bokeh.glyphs import Square
        self.test_square = Square()

    def test_expected_properties(self):
        expected_properties = set(['angle'])
        actual_properties = get_prop_set(type(self.test_square))
        self.assertTrue(expected_properties.issubset(actual_properties))

    def test_expected_values(self):
        self.assertEqual(self.test_square.__view_model__, 'square')

    def test_to_glyphspec(self):
        expected = dict(GENERIC_MARKER_DICT)
        expected['type'] = 'square'
        expected['angle'] = {'units': 'data', 'field': 'angle'}
        self.assertEqual(self.test_square.to_glyphspec(), expected)
        self.test_square.angle = 90
        expected['angle'] = {'units': 'data', 'value': 90}
        self.assertEqual(self.test_square.to_glyphspec(), expected)
Exemple #5
0
class TestSquare(unittest.TestCase):
    def setUp(self):
        from bokeh.glyphs import Square

        self.test_square = Square()

    def test_expected_properties(self):
        expected_properties = set(["angle"])
        actual_properties = get_prop_set(type(self.test_square))
        self.assertTrue(expected_properties.issubset(actual_properties))

    def test_expected_values(self):
        self.assertEqual(self.test_square.__view_model__, "square")

    def test_to_glyphspec(self):
        expected = dict(GENERIC_MARKER_DICT)
        expected["type"] = "square"
        expected["angle"] = {"units": "data", "field": "angle"}
        self.assertEqual(self.test_square.to_glyphspec(), expected)
        self.test_square.angle = 90
        expected["angle"] = {"units": "data", "value": 90}
        self.assertEqual(self.test_square.to_glyphspec(), expected)
Exemple #6
0
 def setUp(self):
     from bokeh.glyphs import Square
     self.test_square = Square()
Exemple #7
0
  Circle(x="x",
         y="y",
         radius=0.1,
         radius_units="data",
         fill_color="#3288BD")),
 ("circle_x",
  CircleX(x="x", y="y", size="sizes", line_color="#DD1C77",
          fill_color=None)),
 ("circle_cross",
  CircleCross(x="x",
              y="y",
              size="sizes",
              line_color="#FB8072",
              fill_color=None,
              line_width=2)),
 ("square", Square(x="x", y="y", size="sizes", fill_color="#74ADD1")),
 ("square_x",
  SquareX(x="x",
          y="y",
          size="sizes",
          line_color="#FDAE6B",
          fill_color=None,
          line_width=2)),
 ("square_cross",
  SquareCross(x="x",
              y="y",
              size="sizes",
              line_color="#7FC97F",
              fill_color=None,
              line_width=2)),
 ("diamond",
Exemple #8
0
 def setUp(self):
     from bokeh.glyphs import Square
     self.test_square = Square()