=== modified file 'linaro_image_tools/fetch_image.py'
@@ -1476,8 +1476,9 @@
("platform", args['platform'])])
else:
- assert(0, "Unexpected args['release_or_snapshot']: {0}".format(
- args['release_or_snapshot']))
+ message = "Unexpected args['release_or_snapshot']: {0}".format(
+ args['release_or_snapshot'])
+ raise AssertionError(message)
if(not image_url):
# If didn't get an image URL set up something so the return line
=== modified file 'linaro_image_tools/tests/test_pyflakes.py'
@@ -29,8 +29,8 @@
(stdout, stderr) = proc.communicate()
stdout = stdout.splitlines()
stdout.sort()
- expected = ["./linaro_image_tools/utils.py:29: redefinition of "
- "unused 'CommandNotFound' from line 27" ]
+ expected = ["./linaro_image_tools/utils.py:30: redefinition of "
+ "unused 'CommandNotFound' from line 28" ]
self.assertEquals(expected, stdout)
self.assertEquals('', stderr)
=== modified file 'linaro_image_tools/tests/test_utils.py'
@@ -22,6 +22,7 @@
import subprocess
import sys
import logging
+import tempfile
from linaro_image_tools import cmd_runner, utils
from linaro_image_tools.testing import TestCaseWithFixtures
@@ -91,14 +92,25 @@
TestVerifyFileIntegrity.filenames_in_shafile) + ': OK\n'
raise cmd_runner.SubcommandNonZeroReturnValue([], 1, stdout, None)
+ class FakeTempFile():
+ name = "/tmp/1"
+
+ def close(self):
+ pass
+
+ def read(self):
+ return ""
def test_verify_files(self):
fixture = self.useFixture(MockCmdRunnerPopenFixture())
+ self.useFixture(MockSomethingFixture(tempfile, 'NamedTemporaryFile',
+ self.FakeTempFile))
hash_filename = "dummy-file.txt"
signature_filename = hash_filename + ".asc"
verify_file_integrity([signature_filename])
self.assertEqual(
- ['gpg --verify %s' % signature_filename,
+ ['gpg --status-file=%s --verify %s' % (self.FakeTempFile.name,
+ signature_filename),
'sha1sum -c %s' % hash_filename],
fixture.mock.commands_executed)