'Test that VERSIONED_METHODS gets data as expected.'

@mock.patch('nova.api.openstack.placement.microversion.VERSIONED_METHODS', new=collections.defaultdict(list))
def test_methods_structure(self):

    self.assertEqual(0, len(microversion.VERSIONED_METHODS))
    fully_qualified_method = microversion._fully_qualified_name(handler)
    microversion.version_handler('1.1', '1.10')(handler)
    microversion.version_handler('2.0')(handler)
    methods_data = microversion.VERSIONED_METHODS[fully_qualified_method]
    stored_method_data = methods_data[(-1)]
    self.assertEqual(2, len(methods_data))
    self.assertEqual(microversion.Version(1, 1), stored_method_data[0])
    self.assertEqual(microversion.Version(1, 10), stored_method_data[1])
    self.assertEqual(handler, stored_method_data[2])
    self.assertEqual(microversion.Version(2, 0), methods_data[0][0])
