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)
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' ])
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']])))
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'])
def test_empties_and_solitaries_deps(): grouplist = [ [ [] ], [ ['one'] ], [ [] ], [ ['two'] ], [ [] ],[ ['three'] ], [ [] ] ] assert_equals( list(flatten(combine_fixture_deps(grouplist))), ['one', 'two', 'three'])
def test_several_empty_deps(): grouplist = [ [ [] ] ] assert_equals( list(flatten(combine_fixture_deps(grouplist))), [])
def test_several_solitary_deps(): grouplist = [ [ ['one'] ], [ ['two'] ], [ ['three'] ] ] assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one', 'two', 'three'])
def test_one_solitary_dep(): grouplist = [ [ ['one'] ] ] assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one'])
def test_independent_single_deps(): grouplist = [ [ ['1','2','3' ,'4', '5'] ] ] assert_equals( list(flatten(combine_fixture_deps(grouplist))), ['1', '2', '3', '4', '5'])
def test_several_empty_deps(): grouplist = [[[]]] assert_equals(list(flatten(combine_fixture_deps(grouplist))), [])
def test_several_solitary_deps(): grouplist = [[['one']], [['two']], [['three']]] assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one', 'two', 'three'])
def test_one_solitary_dep(): grouplist = [[['one']]] assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one'])
def test_independent_single_deps(): grouplist = [[['1', '2', '3', '4', '5']]] assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['1', '2', '3', '4', '5'])
def test_empties_and_solitaries_deps(): grouplist = [[[]], [['one']], [[]], [['two']], [[]], [['three']], [[]]] assert_equals(list(flatten(combine_fixture_deps(grouplist))), ['one', 'two', 'three'])