コード例 #1
0
ファイル: test_plots.py プロジェクト: crashMOGWAI/bokeh
 def test_get_empty(self) -> None:
     obj = bmp._list_attr_splat([])
     with pytest.raises(AttributeError) as e:
         obj.start
     assert str(e.value).endswith(
         "Trying to access %r attribute on an empty 'splattable' list" %
         "start")
コード例 #2
0
ファイル: test_plots.py プロジェクト: crashMOGWAI/bokeh
 def test_set(self) -> None:
     obj = bmp._list_attr_splat([DataRange1d(), DataRange1d()])
     assert len(obj) == 2
     assert isnan(obj[0].start)
     assert isnan(obj[1].start)
     obj.start = 10
     assert obj[0].start == 10
     assert obj[1].start == 10
コード例 #3
0
ファイル: test_plots.py プロジェクト: crashMOGWAI/bokeh
 def test_pop_value(self) -> None:
     obj = bmp._list_attr_splat([1, 2, 3])
     obj.pop(1)
     assert obj == [1, 3]
コード例 #4
0
ファイル: test_plots.py プロジェクト: crashMOGWAI/bokeh
 def test_get_index(self) -> None:
     obj = bmp._list_attr_splat([1, 2, 3])
     assert obj.index(2) == 1
コード例 #5
0
ファイル: test_plots.py プロジェクト: crashMOGWAI/bokeh
 def test_get_set_multi_mismatch(self) -> None:
     obj = bmp._list_attr_splat([LinearAxis(), FactorRange()])
     with pytest.raises(AttributeError) as e:
         obj.formatter.power_limit_low == 10
     assert str(e.value).endswith("list items have no %r attribute" %
                                  "formatter")
コード例 #6
0
ファイル: test_plots.py プロジェクト: crashMOGWAI/bokeh
 def test_set_empty(self) -> None:
     obj = bmp._list_attr_splat([])
     assert len(obj) == 0
     obj.start = 10
     assert len(obj) == 0