def test_grammar_dict():
 g_dict = GrammarDict()
 test = Visualization()
 test_dict = {'axes': [], 'data': [], 'marks': [], 'scales': [], 'legends': []}
 test_str = '{"axes": [], "data": [], "legends": [], "marks": [], "scales": []}'
 nt.assert_equal(test.grammar(), test_dict)
 print json.dumps(test.grammar, sort_keys=True)
 nt.assert_equal(json.dumps(test.grammar, sort_keys=True), test_str)
 nt.assert_equal(g_dict.encoder(test), test.grammar)

def test_grammar_dict ( ) : g_dict = GrammarDict ( ) test = Visualization ( ) test_dict = { 'axes' : [ ] , 'data' : [ ] , 'marks' : [ ] , 'scales' : [ ] , 'legends' : [ ] } test_str = '{"axes": [], "data": [], "legends": [], "marks": [], "scales": []}' nt . assert_equal ( test . grammar ( ) , test_dict ) print json . dumps ( test . grammar , sort_keys = True ) nt . assert_equal ( json . dumps ( test . grammar , sort_keys = True ) , test_str ) nt . assert_equal ( g_dict . encoder ( test ) , test . grammar )
test vincent grammar dict .