def test_tag_operation_enabled(self):
     r = GenericArmResource(self.test_context, {})
     # False for excluded resources
     for t in arm_tags_unsupported:
         self.assertFalse(r.tag_operation_enabled(t))
     # Default true
     self.assertTrue(r.tag_operation_enabled("SomeResource"))
    def test_arm_resource_get_resources(self):
        rm = GenericArmResource(self.test_context,
                                {'policies': [
                                    {'name': 'test',
                                     'resource': 'azure.armresource'}]})

        rg_id = '/subscriptions/{0}/resourceGroups/test_vm'\
                .format(rm.get_session().get_subscription_id())
        ids = ['{0}/providers/Microsoft.Compute/virtualMachines/cctestvm'.format(rg_id),
               rg_id]
        resources = rm.get_resources(ids)
        self.assertEqual(len(resources), 2)
        self.assertEqual({r['type'] for r in resources},
                         {'resourceGroups', 'Microsoft.Compute/virtualMachines'})
        self.assertEqual({r['id'] for r in resources},
                         set(ids))
        self.assertEqual({r['resourceGroup'] for r in resources},
                         {'test_vm'})