def test_create_node_req(self):
        image = self.driver.ex_get_image('debian-7')
        size = self.driver.ex_get_size('n1-standard-1')
        location = self.driver.zone
        network = self.driver.ex_get_network('default')
        tags = ['libcloud']
        metadata = [{'key': 'test_key', 'value': 'test_value'}]
        boot_disk = self.driver.ex_get_volume('lcdisk')
        node_request, node_data = self.driver._create_node_req('lcnode', size,
                                                               image, location,
                                                               network, tags,
                                                               metadata,
                                                               boot_disk)
        self.assertEqual(node_request, '/zones/%s/instances' % location.name)
        self.assertEqual(node_data['metadata']['items'][0]['key'], 'test_key')
        self.assertEqual(node_data['tags']['items'][0], 'libcloud')
        self.assertEqual(node_data['name'], 'lcnode')
        self.assertTrue(node_data['disks'][0]['boot'])
        self.assertIsInstance(node_data['serviceAccounts'], list)
        self.assertIsInstance(node_data['serviceAccounts'][0], dict)
        self.assertEqual(node_data['serviceAccounts'][0]['email'], 'default')
        self.assertIsInstance(node_data['serviceAccounts'][0]['scopes'], list)
        self.assertEqual(len(node_data['serviceAccounts'][0]['scopes']), 1)
dataset/ETHPy150Open apache/libcloud/libcloud/test/compute/test_gce.py/GCENodeDriverTest.test_create_node_req/original