コード例 #1
0
    def test_demo_file_v4(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(
            demo_data.foo_v4_metadata_path)

        self.assertEqual(repo_id, 'redhat/zoo')
        self.assertEqual(repo_tuple.url, 'http://cdn.redhat.com/zoo/bar')
        self.assertEqual(repo_tuple.url_path, '/zoo/bar')
        self.assertEqual(repo_tuple.protected, False)

        schema2_data = json.loads(repo_tuple.schema2_data)
        self.assertTrue(
            'sha256:a1d963a97357110bdbfc70767a495c8df6ddfa9bda4da3183165ca73c3b99'
            '0d2' in schema2_data)
        self.assertTrue('1.25.1-musl' in schema2_data)
        manifest_list_data = json.loads(repo_tuple.manifest_list_data)
        self.assertTrue('bar' in manifest_list_data)
        self.assertTrue(
            'sha256:a90b7a658d44eadc569a296d45217115e61add1a7ae0958f084841c5f3ce7'
            '956' in manifest_list_data)
        manifest_list_amd64 = json.loads(repo_tuple.manifest_list_amd64_tags)
        self.assertTrue('bar' in manifest_list_amd64.keys())
        expected = [
            "sha256:c55544de64a01e157b9d931f5db7a16554a14be19c367f91c9a8cdc46db086bf",
            2
        ]
        self.assertEqual(manifest_list_amd64['bar'], expected)
コード例 #2
0
ファイル: test_data.py プロジェクト: pulp/crane
    def test_demo_file_v2(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(demo_data.foo_v2_metadata_path)

        self.assertEqual(repo_id, 'redhat/foo')
        self.assertEqual(repo_tuple.url, 'http://cdn.redhat.com/foo/bar')
        self.assertEqual(repo_tuple.url_path, '/foo/bar')
        self.assertEqual(repo_tuple.protected, False)
コード例 #3
0
    def test_demo_file_v2(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(
            demo_data.foo_v2_metadata_path)

        self.assertEqual(repo_id, 'redhat/foo')
        self.assertEqual(repo_tuple.url, 'http://cdn.redhat.com/foo/bar')
        self.assertEqual(repo_tuple.url_path, '/foo/bar')
        self.assertEqual(repo_tuple.protected, False)
コード例 #4
0
ファイル: test_data.py プロジェクト: elyezer/crane
    def test_demo_file(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(demo_data.foo_metadata_path)

        self.assertEqual(repo_id, "redhat/foo")
        self.assertEqual(repo_tuple.url, "http://cdn.redhat.com/foo/bar/images/")
        self.assertEqual(repo_tuple.url_path, "/foo/bar/images/")

        images = json.loads(repo_tuple.images_json)
        self.assertTrue({"id": "abc123"} in images)
        self.assertTrue({"id": "xyz789"} in images)
        tags = json.loads(repo_tuple.tags_json)
        self.assertEqual(tags.get("latest"), "abc123")
コード例 #5
0
ファイル: test_data.py プロジェクト: bkearney/crane
    def test_demo_file(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(demo_data.foo_metadata_path)

        self.assertEqual(repo_id, 'redhat/foo')
        self.assertEqual(repo_tuple.url, 'http://cdn.redhat.com/foo/bar/images/')
        self.assertEqual(repo_tuple.url_path, '/foo/bar/images/')

        images = json.loads(repo_tuple.images_json)
        self.assertTrue({'id': 'abc123'} in images)
        self.assertTrue({'id': 'xyz789'} in images)
        tags = json.loads(repo_tuple.tags_json)
        self.assertEqual(tags.get('latest'), 'abc123')
コード例 #6
0
ファイル: test_data.py プロジェクト: pulp/crane
    def test_demo_file_v3(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(demo_data.foo_v3_metadata_path)

        self.assertEqual(repo_id, 'redhat/foo')
        self.assertEqual(repo_tuple.url, 'http://cdn.redhat.com/foo/bar')
        self.assertEqual(repo_tuple.url_path, '/foo/bar')
        self.assertEqual(repo_tuple.protected, False)

        schema2_data = json.loads(repo_tuple.schema2_data)
        self.assertTrue('sha256:a1d963a97357110bdbfc70767a495c8df6ddfa9bda4da3183165ca73c3b99'
                        '0d2' in schema2_data)
        self.assertTrue('1.25.1-musl' in schema2_data)
コード例 #7
0
    def test_demo_file(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(
            demo_data.foo_metadata_path)

        self.assertEqual(repo_id, 'redhat/foo')
        self.assertEqual(repo_tuple.url,
                         'http://cdn.redhat.com/foo/bar/images/')
        self.assertEqual(repo_tuple.url_path, '/foo/bar/images/')

        images = json.loads(repo_tuple.images_json)
        self.assertTrue({'id': 'abc123'} in images)
        self.assertTrue({'id': 'xyz789'} in images)
        tags = json.loads(repo_tuple.tags_json)
        self.assertEqual(tags.get('latest'), 'abc123')
コード例 #8
0
    def test_demo_file_v3(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(
            demo_data.foo_v3_metadata_path)

        self.assertEqual(repo_id, 'redhat/foo')
        self.assertEqual(repo_tuple.url, 'http://cdn.redhat.com/foo/bar')
        self.assertEqual(repo_tuple.url_path, '/foo/bar')
        self.assertEqual(repo_tuple.protected, False)

        schema2_data = json.loads(repo_tuple.schema2_data)
        self.assertTrue(
            'sha256:a1d963a97357110bdbfc70767a495c8df6ddfa9bda4da3183165ca73c3b99'
            '0d2' in schema2_data)
        self.assertTrue('1.25.1-musl' in schema2_data)
コード例 #9
0
ファイル: test_data.py プロジェクト: pulp/crane
    def test_demo_file_v4(self):
        repo_id, repo_tuple, image_ids = data.load_from_file(demo_data.foo_v4_metadata_path)

        self.assertEqual(repo_id, 'redhat/zoo')
        self.assertEqual(repo_tuple.url, 'http://cdn.redhat.com/zoo/bar')
        self.assertEqual(repo_tuple.url_path, '/zoo/bar')
        self.assertEqual(repo_tuple.protected, False)

        schema2_data = json.loads(repo_tuple.schema2_data)
        self.assertTrue('sha256:a1d963a97357110bdbfc70767a495c8df6ddfa9bda4da3183165ca73c3b99'
                        '0d2' in schema2_data)
        self.assertTrue('1.25.1-musl' in schema2_data)
        manifest_list_data = json.loads(repo_tuple.manifest_list_data)
        self.assertTrue('bar' in manifest_list_data)
        self.assertTrue('sha256:a90b7a658d44eadc569a296d45217115e61add1a7ae0958f084841c5f3ce7'
                        '956' in manifest_list_data)
        manifest_list_amd64 = json.loads(repo_tuple.manifest_list_amd64_tags)
        self.assertTrue('bar' in manifest_list_amd64.keys())
        expected = ["sha256:c55544de64a01e157b9d931f5db7a16554a14be19c367f91c9a8cdc46db086bf", 2]
        self.assertEqual(manifest_list_amd64['bar'], expected)