Skip to content

Commit

Permalink
tests: add test case for missing plymouth binary
Browse files Browse the repository at this point in the history
If there's no /usr/bin/plymouth then subprocess.call will raise OSError;
we should have a test case that makes sure that we handle this cleanly.

We actually fail this test right now, which illustrates issue #18.
  • Loading branch information
wgwoods committed Sep 24, 2015
1 parent 509ce20 commit 4d8a42d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_system_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def test_ping_when_dead(self, call):
self.assertEqual(call.call_count, 2)
self.assertTrue(self.ply.alive)

def test_mode_no_plymouth(self, call):
call.side_effect = OSError(2, 'No such file or directory')
self.ply.set_mode("updates")
self.assertFalse(self.ply.alive)

def test_message(self, call):
self.ply.message(self.msg)
call.assert_called_once_with(self.msg_args)
Expand Down

0 comments on commit 4d8a42d

Please sign in to comment.