diff mbox

[Branch,~linaro-maintainers/linaro-image-tools/trunk] Rev 311: Mock os.getuid() in test_append_to_fstab() to avoid calling sudo in the tests.

Message ID 20110404223119.1168.9592.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Loïc Minier April 4, 2011, 10:31 p.m. UTC
------------------------------------------------------------
revno: 311
committer: Loïc Minier <lool@dooz.org>
branch nick: linaro-image-tools
timestamp: Tue 2011-04-05 00:28:58 +0200
message:
  Mock os.getuid() in test_append_to_fstab() to avoid calling sudo in the tests.
modified:
  linaro_image_tools/media_create/tests/test_media_create.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2011-04-04 21:23:58 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2011-04-04 22:28:58 +0000
@@ -1127,6 +1127,9 @@ 
 
     def test_append_to_fstab(self):
         tempdir = self.useFixture(CreateTempDirFixture()).get_temp_dir()
+        # we don't really need root (sudo) as we're not writing to a real
+        # root owned /etc
+        self.useFixture(MockSomethingFixture(os, 'getuid', lambda: 0))
         etc = os.path.join(tempdir, 'etc')
         os.mkdir(etc)
         fstab = os.path.join(etc, 'fstab')