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']
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
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']
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'])
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)
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']
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"])