1import pytest 2import contextlib 3import os 4import tempfile 5 6from rpy2.robjects.lib import grid 7from rpy2.robjects.vectors import FloatVector, StrVector 8 9 10# TODO: is there anything to test ? 11def test_unit(): 12 u = grid.unit(1, 'cm') 13 u = grid.unit(x=1, units='cm') 14 15 16# TODO: is there anything to test ? 17def test_gpar(): 18 g = grid.gpar(col='blue') 19 20 21# TODO: is there anything to test ? 22def test_grob(): 23 g = grid.grob(name='foo') 24 25 26# TODO: is there anything to test ? 27def test_rect(): 28 r = grid.rect(x=grid.unit(0, 'cm')) 29 30 31# TODO: is there anything to test ? 32def test_lines(): 33 l = grid.lines(x=grid.unit(FloatVector([0, 1]), 'cm')) 34 35 36# TODO: is there anything to test ? 37def test_circle(): 38 c = grid.circle(x=0) 39 40 41# TODO: is there anything to test ? 42def test_points(): 43 c = grid.points() 44 45 46# TODO: is there anything to test ? 47def test_text(): 48 t = grid.text('t0') 49 50 51# TODO: is there anything to test ? 52def test_gtree(): 53 g = grid.GTree.gtree() 54 55 56# TODO: is there anything to test ? 57def test_grobtree(): 58 g = grid.GTree.grobtree() 59 60 61# TODO: is there anything to test ? 62@pytest.mark.parametrize('axis', (grid.XAxis.xaxis, grid.YAxis.yaxis)) 63def test_axis(axis): 64 g = axis() 65 66 67# TODO: is there anything to test ? 68@pytest.mark.parametrize('axisgrob', (grid.XAxis.xaxisgrob, grid.YAxis.yaxisgrob)) 69def test_axisgrob(axisgrob): 70 g = axisgrob() 71 72 73# TODO: is there anything to test ? 74def test_viewport(): 75 v = grid.viewport() 76