Skip to content

Commit 7b1855a

Browse files
committed
Ignore queue creation tests if the user running the tests is root
Otherwise they'll never pass as the root user will be able to create '/oops' :). The idea of the tests are to see that Jens throws an exception if the dirq cannot be auto-created because of FS constraints.
1 parent 25376e2 commit 7b1855a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jens/test/test_messaging.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ def test_fetch_all_messages_no_queuedir_is_created(self):
8686
self.assertEqual(0, len(msgs))
8787

8888
def test_fetch_all_messages_queuedir_cannot_be_created(self):
89+
if os.getuid() == 0:
90+
return
8991
self.settings.MESSAGING_QUEUEDIR = "/oops"
9092
self.assertRaises(JensMessagingError, _fetch_all_messages)
9193

9294
def test_purge_queue_queuedir_does_not_exist(self):
95+
if os.getuid() == 0:
96+
return
9397
self.settings.MESSAGING_QUEUEDIR = "/oops"
9498
self.assertRaises(JensMessagingError, purge_queue)
9599

0 commit comments

Comments
 (0)