def test_grammar_dict(): """Test Vincent Grammar Dict""" g_dict = GrammarDict() test = Visualization() test_dict = {'axes': [], 'data': [], 'marks': [], 'scales': [], 'legends': []} test_str = ('{"marks": [], "axes": [], "data": [],' ' "legends": [], "scales": []}') nt.assert_equal(test.grammar(), test_dict) nt.assert_equal(str(test.grammar), test_str) nt.assert_equal(g_dict.encoder(test), test.grammar)
def test_grammar_dict(): """Test Vincent 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(): """Test Vincent 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)