File: docker-source.py

package info (click to toggle)
bst-external 0.29.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 664 kB
  • sloc: python: 3,936; makefile: 53
file content (29 lines) | stat: -rw-r--r-- 859 bytes parent folder | download | duplicates (2)
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
import os
import pytest

from tests.testutils import cli
from tests.testutils.integration import assert_contains

DATA_DIR = os.path.join(
    os.path.dirname(os.path.realpath(__file__)),
    "project"
)

@pytest.mark.datafiles(DATA_DIR)
def test_docker_fetch(cli, datafiles):
    project = str(datafiles)
    result = cli.run(project=project, args=['fetch', 'dockerhub-alpine.bst'])
    result.assert_success()

@pytest.mark.datafiles(DATA_DIR)
def test_docker_source_build(cli, datafiles):
    project = str(datafiles)
    checkout = os.path.join(cli.directory, 'checkout')

    result = cli.run(project=project, args=['build', 'docker-source-test.bst'])
    result.assert_success()

    result = cli.run(project=project, args=['checkout', 'docker-source-test.bst', checkout])
    result.assert_success()

    assert_contains(checkout, ['/etc/os-release'])