-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_data.py
More file actions
45 lines (34 loc) · 1.53 KB
/
test_data.py
File metadata and controls
45 lines (34 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# *****************************************************************************
# Copyright (c) 2024 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# *****************************************************************************
from mas.devops.data import (
getCatalog,
getNewestCatalogTag,
listCatalogTags,
NoSuchCatalogError,
)
import pytest
def test_catalog():
# We don't need to update this to the latest version each monthly update
catalogData = getCatalog("v9-241107-amd64")
assert catalogData["catalog_digest"] == "sha256:2d470131ab6948d5262553547fafa1b472fa25690be5abba8719ad7493cd8911"
def test_list_catalogs():
catalogList = listCatalogTags("amd64")
assert len(catalogList) > 0
assert "v9-250109-amd64" in catalogList
def test_get_newest_catalog_tag():
catalogTag = getNewestCatalogTag("amd64")
# Reminder: update this test when adding a new catalog each month!
assert catalogTag == "v9-260414-amd64"
def test_get_newest_catalog_tag_fail():
with pytest.raises(NoSuchCatalogError, match="There are no known catalogs for the doesntexist platform"):
getNewestCatalogTag("doesntexist")
def test_get_catalog_fail():
with pytest.raises(NoSuchCatalogError, match="Catalog nonexistent-catalog is unknown"):
getCatalog("nonexistent-catalog")