Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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)