コード例 #1
0
ファイル: test_db.py プロジェクト: AsylumCorp/glance
    def test_image_tag_get_all(self):
        db_api.image_tag_create(self.context, UUID1, 'snap')
        db_api.image_tag_create(self.context, UUID1, 'snarf')
        db_api.image_tag_create(self.context, UUID2, 'snarf')

        # Check the tags for the first image
        tag_refs = db_api.image_tag_get_all(self.context, UUID1)
        tags = [(t.image_id, t.value) for t in tag_refs]
        expected = [(UUID1, 'snap'), (UUID1, 'snarf')]
        self.assertEqual(expected, tags)

        # Check the tags for the second image
        tag_refs = db_api.image_tag_get_all(self.context, UUID2)
        tags = [(t.image_id, t.value) for t in tag_refs]
        expected = [(UUID2, 'snarf')]
        self.assertEqual(expected, tags)
コード例 #2
0
ファイル: test_db.py プロジェクト: altai/glance
    def test_image_tag_get_all(self):
        db_api.image_tag_create(self.context, UUID1, 'snap')
        db_api.image_tag_create(self.context, UUID1, 'snarf')
        db_api.image_tag_create(self.context, UUID2, 'snarf')

        # Check the tags for the first image
        tag_refs = db_api.image_tag_get_all(self.context, UUID1)
        tags = [(t.image_id, t.value) for t in tag_refs]
        expected = [(UUID1, 'snap'), (UUID1, 'snarf')]
        self.assertEqual(expected, tags)

        # Check the tags for the second image
        tag_refs = db_api.image_tag_get_all(self.context, UUID2)
        tags = [(t.image_id, t.value) for t in tag_refs]
        expected = [(UUID2, 'snarf')]
        self.assertEqual(expected, tags)
コード例 #3
0
ファイル: test_db.py プロジェクト: AsylumCorp/glance
 def test_image_tag_get_all_no_tags(self):
     self.assertEqual([], db_api.image_tag_get_all(self.context, UUID1))
コード例 #4
0
ファイル: test_db.py プロジェクト: altai/glance
 def test_image_tag_get_all_no_tags(self):
     self.assertEqual([], db_api.image_tag_get_all(self.context, UUID1))