~nskaggs/juju-ci-tools/add-essential-operations

« back to all changes in this revision

Viewing changes to tests/test_gotesttarfile.py

  • Committer: Curtis Hovey
  • Date: 2016-07-15 17:38:07 UTC
  • mto: (1505.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 1508.
  • Revision ID: curtis@canonical.com-20160715173807-j9o9c76y8ipx8ulu
Revisions per review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        run_mock.assert_called_with(
113
113
            ['taskkill.exe', '/F', '/FI', 'imagename eq mongod.exe'])
114
114
 
 
115
    def test_go_test_package_compile_failure(self):
 
116
        with temp_dir() as gopath:
 
117
            package_path = os.path.join(
 
118
                gopath, 'src', 'github.com', 'juju', 'juju')
 
119
            os.makedirs(package_path)
 
120
            with patch('gotesttarfile.run', return_value=1,
 
121
                       autospec=True) as run_mock:
 
122
                devnull = open(os.devnull, 'w')
 
123
                with patch('sys.stdout', devnull):
 
124
                    returncode = go_test_package(
 
125
                        'github.com/juju/juju', 'go', gopath)
 
126
        self.assertEqual(1, returncode)
 
127
        self.assertEqual(run_mock.call_count, 1)
 
128
        args, kwargs = run_mock.call_args_list[0]
 
129
        self.assertEqual((['go', 'test', '-i', './...'],), args)
 
130
 
115
131
    def test_parse_args(self):
116
132
        args = parse_args(
117
133
            ['-v', '-g', 'go', '-p' 'github/foo', '-r', 'juju.tar.gz'])