Esempio n. 1
0
def test_archive_image_if_image_tag_in_params():
    image_importer = ImageImporter()
    image_importer.archive_image_with_python = mock.Mock()
    image_importer.archive_image(
        "gitlab-registry.cern.ch/atrisovi/test-dockint", "tmp",
        image_tag='my_image')
    assert image_importer.image_tag == 'my_image'
Esempio n. 2
0
def test_archive_image_if_no_colon_in_image_name():
    image_importer = ImageImporter()
    image_importer.archive_image_with_python = mock.Mock()
    image_importer.archive_image(
        "gitlab-registry.cern.ch/atrisovi/test-dockint", "tmp")
    assert image_importer.image_name == \
        'gitlab-registry.cern.ch/atrisovi/test-dockint'
    assert image_importer.image_tag == 'latest'
Esempio n. 3
0
def test_image_importer_if_no_username_and_token_in_params():
    image_importer = ImageImporter()
    assert image_importer.username is None
    assert image_importer.token is None
    assert image_importer.image_name is None
    assert image_importer.image_tag is None
    assert image_importer.location is None
Esempio n. 4
0
def test_image_importer_if_username_and_token_in_params():
    image_importer = ImageImporter(username='******', token='fun_token')
    assert image_importer.username == 'atrisovi'
    assert image_importer.token == 'fun_token'
    assert image_importer.image_name is None
    assert image_importer.image_tag is None
    assert image_importer.location is None
Esempio n. 5
0
def test_archive_image_if_location_with_slash():
    image_importer = ImageImporter()
    image_importer.archive_image_with_python = mock.Mock()
    image_importer.archive_image(
        "gitlab-registry.cern.ch/atrisovi/test-dockint:hello", "tmp/")
    assert image_importer.location == 'tmp'
Esempio n. 6
0
def test_image_importer_if_username_and_token_in_params():
    image_importer = ImageImporter(username='******', token='fun_token')
    assert image_importer.username == 'atrisovi'
    assert image_importer.token == 'fun_token'