Added parent directory to import path to host test script so we can now impoer workspace_tools.* as we do in other scripts - problem was host_test.py and other tests run with custom CWD and imports are not easy to maintain

pull/475/head
Przemek Wirkus 2014-09-01 16:10:24 +01:00
parent e25ffc7856
commit 2c166222b6
2 changed files with 6 additions and 2 deletions

View File

@ -27,9 +27,12 @@ from optparse import OptionParser
from time import sleep
from sys import stdout
# This is a little tricky. We need to add upper directory to path so
# we can find packages we want from the same level as other files do
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from private_settings import EACOMMANDER_CMD
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
from workspace_tools.settings import EACOMMANDER_CMD
class Mbed:
""" Base class for a host driven test

View File

@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from os.path import join, abspath, dirname
import logging