~hloeung/mojo/force-destroy-model

« back to all changes in this revision

Viewing changes to mojo/tests/test_mojo.py

  • Committer: mergebot at canonical
  • Author(s): "Stuart Bishop"
  • Date: 2020-05-04 09:16:18 UTC
  • mfrom: (545.2.21 py3-2)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20200504091618-u4jtm3e0un3mdpfx
Switch packaging to Python3

Reviewed-on: https://code.launchpad.net/~stub/mojo/py3-2/+merge/382991
Reviewed-by: Tom Haddon <tom.haddon@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright 2014 Canonical Ltd.  This software is licensed under the
2
2
# GNU General Public License version 3 (see the file LICENSE).
3
 
from __future__ import absolute_import
4
3
import json
5
4
import os
 
5
from shutil import rmtree
6
6
import subprocess
7
7
import sys
 
8
from tempfile import mkdtemp
8
9
import time
9
 
 
10
 
from shutil import rmtree
11
 
from tempfile import mkdtemp
12
 
from unittest import TestCase
13
 
 
14
 
import six
 
10
from unittest import mock, TestCase
 
11
 
15
12
import mojo.project
16
13
import mojo.spec
17
 
 
 
14
from mojo.tests.utils import MojoTestCaseMixin
18
15
from mojo.utils import chdir, is_config_line
19
 
from mojo.tests.utils import MojoTestCaseMixin
20
16
 
 
17
# TODO: Change this to use relative imports, ensuring local mojo is
 
18
# not only importable but is being tested.
 
19
#
21
20
# Make sure that the local mojo is importable
22
21
import mojo.workspace
23
22
 
24
 
if six.PY2:
25
 
    import mock
26
 
else:
27
 
    from unittest import mock
28
 
 
29
 
 
30
23
local_copy = os.path.join(os.path.dirname(os.path.dirname(__file__)), "..", "mojo")
31
24
if os.path.exists(local_copy) and os.path.isdir(local_copy):
32
25
    sys.path.insert(0, local_copy)