Exemple #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)
Exemple #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'
    ])
Exemple #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)
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']])))
Exemple #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']])))
Exemple #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'])
Exemple #7
0
def test_empties_and_solitaries_deps():
    grouplist = [
        [ [] ], [   ['one'] ], [ [] ], [   ['two'] ], [ [] ],[   ['three'] ], [ [] ]  ]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        ['one', 'two', 'three'])
Exemple #8
0
def test_several_empty_deps():
    grouplist = [
        [ [] ]  ]
    assert_equals(
        list(flatten(combine_fixture_deps(grouplist))),
        [])
Exemple #9
0
def test_several_solitary_deps():
    grouplist = [
        [   ['one'] ], [   ['two'] ], [   ['three'] ]  ]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one', 'two', 'three'])
Exemple #10
0
def test_one_solitary_dep():
    grouplist = [
        [   ['one'] ]  ]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one'])
Exemple #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'])
Exemple #12
0
def test_several_empty_deps():
    grouplist = [[[]]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), [])
Exemple #13
0
def test_several_solitary_deps():
    grouplist = [[['one']], [['two']], [['three']]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))),
                  ['one', 'two', 'three'])
Exemple #14
0
def test_one_solitary_dep():
    grouplist = [[['one']]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one'])
Exemple #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'])
Exemple #16
0
def test_empties_and_solitaries_deps():
    grouplist = [[[]], [['one']], [[]], [['two']], [[]], [['three']], [[]]]
    assert_equals(list(flatten(combine_fixture_deps(grouplist))),
                  ['one', 'two', 'three'])