示例#1
0
    def test_url_unspecified(self):
        """Ensures no URL when URL is unspecified."""
        key = models.InstanceTemplateRevision(
            key=instance_templates.get_instance_template_revision_key(
                'base-name',
                'revision',
            ), ).put()

        self.failIf(instance_templates.get_instance_template_to_delete(key))
  def test_url_unspecified(self):
    """Ensures no URL when URL is unspecified."""
    key = models.InstanceTemplateRevision(
        key=instance_templates.get_instance_template_revision_key(
            'base-name',
            'revision',
        ),
    ).put()

    self.failIf(instance_templates.get_instance_template_to_delete(key))
  def test_returns_url(self):
    """Ensures URL is returned."""
    key = models.InstanceTemplateRevision(
        key=instance_templates.get_instance_template_revision_key(
            'base-name',
            'revision',
        ),
        url='url',
    ).put()
    expected_url = 'url'

    self.assertEqual(
        instance_templates.get_instance_template_to_delete(key), expected_url)
示例#4
0
    def test_returns_url(self):
        """Ensures URL is returned."""
        key = models.InstanceTemplateRevision(
            key=instance_templates.get_instance_template_revision_key(
                'base-name',
                'revision',
            ),
            url='url',
        ).put()
        expected_url = 'url'

        self.assertEqual(
            instance_templates.get_instance_template_to_delete(key),
            expected_url)
示例#5
0
    def test_drained_instance_group_managers(self):
        """Ensures no URL when there are drained instance group managers."""
        key = models.InstanceTemplateRevision(
            key=instance_templates.get_instance_template_revision_key(
                'base-name',
                'revision',
            ),
            drained=[
                ndb.Key(models.InstanceGroupManager, 'fake-key'),
            ],
            url='url',
        ).put()

        self.failIf(instance_templates.get_instance_template_to_delete(key))
  def test_drained_instance_group_managers(self):
    """Ensures no URL when there are drained instance group managers."""
    key = models.InstanceTemplateRevision(
        key=instance_templates.get_instance_template_revision_key(
            'base-name',
            'revision',
        ),
        drained=[
            ndb.Key(models.InstanceGroupManager, 'fake-key'),
        ],
        url='url',
    ).put()

    self.failIf(instance_templates.get_instance_template_to_delete(key))
示例#7
0
 def test_entity_doesnt_exist(self):
     """Ensures no URL when the entity doesn't exist."""
     key = ndb.Key(models.InstanceTemplateRevision, 'fake-key')
     self.failIf(instance_templates.get_instance_template_to_delete(key))
 def test_entity_doesnt_exist(self):
   """Ensures no URL when the entity doesn't exist."""
   key = ndb.Key(models.InstanceTemplateRevision, 'fake-key')
   self.failIf(instance_templates.get_instance_template_to_delete(key))