~andrewjbeach/juju-ci-tools/get-juju-dict

« back to all changes in this revision

Viewing changes to test_jujupy.py

  • Committer: Curtis Hovey
  • Date: 2015-05-18 18:41:02 UTC
  • mto: This revision was merged to the branch mainline in revision 957.
  • Revision ID: curtis@canonical.com-20150518184102-1rz340oezi7timqi
Hush py3 lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    test_case.assertEqual(args, (expected_args,))
57
57
    kwarg_keys = ['env']
58
58
    if assign_stderr:
59
 
        kwarg_keys = ['stderr'] + kwarg_keys
60
 
        test_case.assertEqual(type(kwargs['stderr']), file)
 
59
        with tempfile.TemporaryFile() as example:
 
60
            # 'example' is a pragmatic way of checking file types in py2 and 3.
 
61
            kwarg_keys = ['stderr'] + kwarg_keys
 
62
            test_case.assertIsInstance(kwargs['stderr'], type(example))
61
63
    test_case.assertItemsEqual(kwargs.keys(), kwarg_keys)
62
64
    bin_dir = os.path.dirname(client.full_path)
63
65
    test_case.assertRegexpMatches(kwargs['env']['PATH'],