'Test the create_top_level_item function.'

def test_should_create_a_valid_top_item_on_create_top_level_item(self):

    dict_children = odict()
    dict_children[u'child_1'] = {}
    dict_children[u'child_2'] = odict()
    dict_children[u'child_2'][u'child_2_1'] = {}
    dict_children[u'child_2'][u'child_2_2'] = {}
    tree_helper = BranchesTreeHelper()
    result = tree_helper.create_top_level_item(u'top', dict_children)
    self.assertEqual(u'top', result.name)
    self.assertEqual(2, result.childCount())
    self.assertEqual(u'child_1', result.child(0).name)
    self.assertEqual(u'child_2', result.child(1).name)
    self.assertEqual(2, result.child(1).childCount())
    self.assertEqual(u'child_2_1', result.child(1).child(0).name)
    self.assertEqual(u'child_2_2', result.child(1).child(1).name)
