Ejemplo n.º 1
0
def test_stat_no_repeat():
    t = G.Stat(title='dummy',
               dataSource='data source',
               targets=[G.Target(expr='some expr')])

    assert t.to_json_data()['repeat'] is None
    assert t.to_json_data()['repeatDirection'] is None
    assert t.to_json_data()['maxPerRow'] is None
Ejemplo n.º 2
0
def test_stat_with_repeat():
    t = G.Stat(title='dummy',
               dataSource='data source',
               targets=[G.Target(expr='some expr')],
               repeat=G.Repeat(variable="repetitionVariable",
                               direction='h',
                               maxPerRow=10))

    assert t.to_json_data()['repeat'] == 'repetitionVariable'
    assert t.to_json_data()['repeatDirection'] == 'h'
    assert t.to_json_data()['maxPerRow'] == 10