예제 #1
0
def test_create_context_result_nested_vals():
    assert create_context_result(DICT_1to5, TRANS_DICT_NESTED_VAL_12) == {
        'one': {
            '1': 1
        },
        'two': 2
    }
예제 #2
0
def test_create_context_result_basic():
    assert create_context_result(DICT_1to5, TRANS_DICT_134) == {
        'one': 1,
        'three': 3,
        'four': 4
    }
    assert 'one' not in DICT_1to5
예제 #3
0
def test_create_context_result_list():
    assert create_context_result(DICT_LST_AAB2B, TRANS_DICT_LST_A2B) == {
        'AaB': [{
            'two': 2
        }, {
            'two': 3
        }],
        'four': 4
    }
    assert create_context_result(DICT_LST_NESTED, TRANS_DICT_LST_NESTED) == {
        'Master': {
            'ID': 1,
            'Assets': [{
                'ID': 1,
                'Name': 'a'
            }, {
                'ID': 2,
                'Name': 'b'
            }]
        }
    }
예제 #4
0
def test_create_context_result_nested_keys():
    assert create_context_result(DICT_NESTED_123, TRANS_DICT_NESTED_12) == {
        'one': 1,
        'two': 2
    }