コード例 #1
0
 def test_dataspec_value_in_json(self) -> None:
     from bokeh.models import AnnularWedge
     obj = AnnularWedge()
     obj.start_angle = 60
     json = obj.to_json(include_defaults=True)
     assert 'start_angle' in json
     assert 'start_angle_units' not in json
     assert dict(units='rad', value=60) == json['start_angle']
コード例 #2
0
 def test_no_units_in_json(self) -> None:
     from bokeh.models import AnnularWedge
     obj = AnnularWedge()
     json = obj.to_json(include_defaults=True)
     assert 'start_angle' in json
     assert 'start_angle_units' not in json
     assert 'outer_radius' in json
     assert 'outer_radius_units' not in json
コード例 #3
0
 def test_dataspec_field_in_json(self) -> None:
     from bokeh.models import AnnularWedge
     obj = AnnularWedge()
     obj.start_angle = "fieldname"
     json = obj.to_json(include_defaults=True)
     assert 'start_angle' in json
     assert 'start_angle_units' not in json
     assert dict(units='rad', field='fieldname') == json['start_angle']
コード例 #4
0
ファイル: test_objects.py プロジェクト: ghyde/bokeh
 def test_dataspec_value_in_json(self):
     from bokeh.models import AnnularWedge
     obj = AnnularWedge()
     obj.start_angle = 60
     json = obj.to_json(include_defaults=True)
     self.assertTrue('start_angle' in json)
     self.assertTrue('start_angle_units' not in json)
     self.assertDictEqual(dict(units='rad', value=60), json['start_angle'])
コード例 #5
0
ファイル: test_objects.py プロジェクト: ghyde/bokeh
 def test_no_units_in_json(self):
     from bokeh.models import AnnularWedge
     obj = AnnularWedge()
     json = obj.to_json(include_defaults=True)
     self.assertTrue('start_angle' in json)
     self.assertTrue('start_angle_units' not in json)
     self.assertTrue('outer_radius' in json)
     self.assertTrue('outer_radius_units' not in json)
コード例 #6
0
ファイル: test_objects.py プロジェクト: HuntJSparra/bokeh
 def test_dataspec_field_in_json(self):
     from bokeh.models import AnnularWedge
     obj = AnnularWedge()
     obj.start_angle = "fieldname"
     json = obj.to_json(include_defaults=True)
     assert 'start_angle' in json
     assert 'start_angle_units' not in json
     assert dict(units='rad', field='fieldname') == json['start_angle']
コード例 #7
0
 def test_dataspec_value_in_json(self):
     from bokeh.models import AnnularWedge
     obj = AnnularWedge()
     obj.start_angle = 60
     json = obj.to_json(include_defaults=True)
     self.assertTrue('start_angle' in json)
     self.assertTrue('start_angle_units' not in json)
     self.assertDictEqual(dict(units='rad', value=60), json['start_angle'])
コード例 #8
0
ファイル: test_objects.py プロジェクト: quasiben/bokeh
    def test_dataspec_field_in_json(self):
        from bokeh.models import AnnularWedge

        obj = AnnularWedge()
        obj.start_angle = "fieldname"
        json = obj.to_json(include_defaults=True)
        self.assertTrue("start_angle" in json)
        self.assertTrue("start_angle_units" not in json)
        self.assertDictEqual(dict(units="rad", field="fieldname"), json["start_angle"])