Пример #1
0
def get_img():
    img_file = "/tmp/.images.yml"
    if os.path.exists(img_file):
        imgs = utils.yaml_parser(img_file)["data"]
    else:
        imgs = list(reversed([img.name for img in list(image.get_list())]))
        utils.yaml_create(img_file, {"data": imgs})
    return imgs
Пример #2
0
def get_img():
    # utils.log_info("Get images data...")
    img_file = "/tmp/.images.yml"
    if os.path.exists(img_file):
        imgs = utils.yaml_parser(img_file)["data"]
    else:
        imgs = list(reversed([img.name for img in list(image.get_list())]))
        utils.yaml_create(img_file, {"data": imgs})
    return imgs
Пример #3
0
def get_img():
    temp = utils.tmp_dir()
    img_file = os.path.join(temp, "images.yml")
    if os.path.exists(img_file):
        imgs = utils.yaml_parser(img_file)["data"]
    else:
        imgs = list(reversed([img.name for img in list(image.get_list())]))
        utils.yaml_create(img_file, {"data": imgs})
    return imgs
Пример #4
0
 def test_get_list(self, monkeypatch):
     monkeypatch.setattr(neo.libs.image, "get_image_client",
                         self.fake_client_list_images)
     assert image.get_list("fake_session") == ["fake_img1", "fake_img2"]