IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
瀏覽代碼

Add test_command_image_tag().

master
父節點
當前提交
14d5b8e67f
共有 1 個文件被更改,包括 23 次插入1 次删除
  1. +23
    -1
      tests/test_image.py

+ 23
- 1
tests/test_image.py 查看文件

@@ -2,7 +2,8 @@ import pytest
from focker.image import validate_spec, \
build_squeeze, \
build, \
command_image_build
command_image_build, \
command_image_tag
import subprocess
from tempfile import TemporaryDirectory
import focker.image
@@ -120,3 +121,24 @@ def test_command_image_build():
subprocess.check_output(['focker', 'image', 'remove', '-R', 'test-command-image-build-base'])
assert not os.path.exists(mountpoint)
def test_command_image_tag():
focker_unlock()
subprocess.check_output(['focker', 'image', 'remove', '--force', '-R', 'test-command-image-tag'])
subprocess.check_output(['focker', 'bootstrap', '--dry-run', '-t', 'test-command-image-tag'])
name_1, sha256_1 = zfs_find('test-command-image-tag', focker_type='image')
args = lambda: 0
args.reference = sha256_1
args.tags = ['test-a', 'test-b', 'test-c']
command_image_tag(args)
for t in args.tags:
name_2, sha256_2 = zfs_find(t, focker_type='image')
assert name_2 == name_1
assert sha256_2 == sha256_1
subprocess.check_output(['focker', 'image', 'remove', '-R', 'test-command-image-tag'])
for t in args.tags:
with pytest.raises(ValueError):
zfs_find(t, focker_type='image')
with pytest.raises(ValueError):
zfs_find('test-command-image-tag', focker_type='image')

Loading…
取消
儲存