예제 #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
예제 #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