summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-12-20 18:47:08 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-12-20 18:59:34 -0500
commit1495ff931035011543c67fa0fd4e891373c63554 (patch)
tree597e6e9a8da7cd195fa14f71fe401d74f7896760
parentdf0a7823af48dbe3f827147a9124e72764bff8e0 (diff)
downloadbuildstream-1495ff931035011543c67fa0fd4e891373c63554.tar.gz
Fixing tests to adapt to new setup of ProgramNotFound exception
-rw-r--r--tests/artifactcache/tar.py7
-rw-r--r--tests/testutils/site.py3
2 files changed, 4 insertions, 6 deletions
diff --git a/tests/artifactcache/tar.py b/tests/artifactcache/tar.py
index d982aab01..4a2f5658a 100644
--- a/tests/artifactcache/tar.py
+++ b/tests/artifactcache/tar.py
@@ -6,8 +6,7 @@ from contextlib import ExitStack
import pytest
from buildstream._artifactcache.tarcache import Tar
-from buildstream.utils import get_host_tool
-from buildstream._exceptions import ProgramNotFoundError
+from buildstream import utils, ProgramNotFoundError
# Test that it 'works' - this may be equivalent to test_archive_no_tar()
@@ -37,7 +36,7 @@ def test_archive_no_tar():
try:
for tar in ['gtar', 'tar']:
with pytest.raises(ProgramNotFoundError):
- get_host_tool(tar)
+ utils.get_host_tool(tar)
# Run the same test as before, this time 'tar' should not be available
test_archive_default()
@@ -72,7 +71,7 @@ def test_extract_no_tar():
# Ensure we can't find 'tar' or 'gtar'
for tar in ['gtar', 'tar']:
with pytest.raises(ProgramNotFoundError):
- get_host_tool(tar)
+ utils.get_host_tool(tar)
# Run the same test as before, this time 'tar' should not be available
try:
diff --git a/tests/testutils/site.py b/tests/testutils/site.py
index fb57c404b..e746d4a0f 100644
--- a/tests/testutils/site.py
+++ b/tests/testutils/site.py
@@ -4,8 +4,7 @@
import os
import sys
-from buildstream import utils
-from buildstream._exceptions import ProgramNotFoundError
+from buildstream import utils, ProgramNotFoundError
try:
utils.get_host_tool('bzr')