Ejemplo n.º 1
0
def test_combine_fixtures_basic():
    grouplist1 = [
        [   ['single-node'],
            ['novaclient-users' , 'novaclient-network'],
            ['novaclient-images'] , ['novaclient-keys'], ['novaclient-flatnetwork']  ],
        [   ['single-node'],
            ['novaclient-users' , 'novaclient-network'],
            ['novaclient-images'],
            ['novaclient-keys']  ],
        [   ['single-node'],
            ['novaclient-users', 'novaclient-network'],
            ['novaclient-images'],
            ['novaclient-keys'],
            ['volume-services'],
            ['volume']  ]   ]
    result = combine_fixture_deps(grouplist1)
    expected = ['single-node',
                'novaclient-network',
                'novaclient-users',
                'novaclient-images',
                'novaclient-keys',
                'volume-services',
                'novaclient-flatnetwork',
                'volume']
    assert_equals(list(flatten(result)), expected)
Ejemplo n.º 2
0
def test_empties_solitaries_indepent_and_usual_deps():
    grouplist = [[[]], [['one']], [[]], [['two']], [[]], [['three']], [[]],
                 [['four'], ['five'], ['six']], [[]],
                 [['seven', 'eight', 'nine']], [[]]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), [
        'four', 'five', 'six', 'one', 'two', 'three', 'seven', 'eight', 'nine'
    ])
Ejemplo n.º 3
0
def test_combine_fixtures_basic():
    grouplist1 = [
        [   ['single-node'],
            ['novaclient-users' , 'novaclient-network'],
            ['novaclient-images'] , ['novaclient-keys'], ['novaclient-flatnetwork']  ],
        [   ['single-node'],
            ['novaclient-users' , 'novaclient-network'],
            ['novaclient-images'],
            ['novaclient-keys']  ],
        [   ['single-node'],
            ['novaclient-users', 'novaclient-network'],
            ['novaclient-images'],
            ['novaclient-keys'],
            ['volume-services'],
            ['volume']  ]   ]
    result = combine_fixture_deps(grouplist1)
    expected = ['single-node',
                'novaclient-network',
                'novaclient-users',
                'novaclient-images',
                'novaclient-keys',
                'novaclient-flatnetwork',
                'volume-services',
                'volume']
    assert_equals(list(flatten(result)), expected)
Ejemplo n.º 4
0
def test_no_solitary_duplication():
    grouplist =[[],
        [[u'single-node.clean.setup'], [u'keystone-init.setup'], [u'keystone-user.setup'], [u'novaclient-network.setup'], [u'novarc-keystone.setup'], [u'novaclient-images.setup'], [u'novaclient-keys.setup']],
        [[u'novaclient-keys.setup']],
        [],
        [[u'single-node.clean.setup'], [u'novaclient-users.setup'], [u'novaclient-network.setup'], [u'novaclient-images.setup'], [u'novaclient-keys.setup']],
        [[u'lvm.setup']]]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        list(flatten([[u'single-node.clean.setup'],
            [u'keystone-init.setup', u'novaclient-users.setup'],
            [u'keystone-user.setup'],
            [u'novaclient-network.setup'],
            [u'novarc-keystone.setup'],
            [u'novaclient-images.setup'],
            [u'novaclient-keys.setup'],
            [u'lvm.setup']])))
Ejemplo n.º 5
0
def test_no_solitary_duplication():
    grouplist =[[],
        [[u'single-node.clean.setup'], [u'keystone-init.setup'], [u'keystone-user.setup'], [u'novaclient-network.setup'], [u'novarc-keystone.setup'], [u'novaclient-images.setup'], [u'novaclient-keys.setup']],
        [[u'novaclient-keys.setup']],
        [],
        [[u'single-node.clean.setup'], [u'novaclient-users.setup'], [u'novaclient-network.setup'], [u'novaclient-images.setup'], [u'novaclient-keys.setup']],
        [[u'lvm.setup']]]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        list(flatten([[u'single-node.clean.setup'],
            [u'keystone-init.setup', u'novaclient-users.setup'],
            [u'keystone-user.setup'],
            [u'novaclient-network.setup'],
            [u'novarc-keystone.setup'],
            [u'novaclient-images.setup'],
            [u'novaclient-keys.setup'],
            [u'lvm.setup']])))
Ejemplo n.º 6
0
def test_empties_solitaries_indepent_and_usual_deps():
    grouplist = [
        [ [] ],
        [ ['one'] ],
        [ [] ],
        [ ['two'] ],
        [ [] ],
        [ ['three'] ],
        [ [] ],
        [ ['four'], ['five'], ['six']],
        [ [] ],
        [ ['seven','eight', 'nine'] ],
        [ [] ] ]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        ['four', 'five', 'six', 'one', 'two', 'three', 'seven', 'eight', 'nine'])
Ejemplo n.º 7
0
def test_empties_and_solitaries_deps():
    grouplist = [
        [ [] ], [   ['one'] ], [ [] ], [   ['two'] ], [ [] ],[   ['three'] ], [ [] ]  ]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        ['one', 'two', 'three'])
Ejemplo n.º 8
0
def test_several_empty_deps():
    grouplist = [
        [ [] ]  ]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        [])
Ejemplo n.º 9
0
def test_several_solitary_deps():
    grouplist = [
        [   ['one'] ], [   ['two'] ], [   ['three'] ]  ]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one', 'two', 'three'])
Ejemplo n.º 10
0
def test_one_solitary_dep():
    grouplist = [
        [   ['one'] ]  ]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one'])
Ejemplo n.º 11
0
def test_independent_single_deps():
    grouplist = [
        [ ['1','2','3' ,'4', '5'] ]   ]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        ['1', '2', '3', '4', '5'])
Ejemplo n.º 12
0
def test_several_empty_deps():
    grouplist = [[[]]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), [])
Ejemplo n.º 13
0
def test_several_solitary_deps():
    grouplist = [[['one']], [['two']], [['three']]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))),
                  ['one', 'two', 'three'])
Ejemplo n.º 14
0
def test_one_solitary_dep():
    grouplist = [[['one']]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one'])
Ejemplo n.º 15
0
def test_independent_single_deps():
    grouplist = [[['1', '2', '3', '4', '5']]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))),
                  ['1', '2', '3', '4', '5'])
Ejemplo n.º 16
0
def test_empties_and_solitaries_deps():
    grouplist = [[[]], [['one']], [[]], [['two']], [[]], [['three']], [[]]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))),
                  ['one', 'two', 'three'])