def test_notifications(self):
     """Test the desktop notification functionality."""
     program = RsyncSystemBackup(destination='/backups/system')
     # Right now we just make sure the Python code doesn't contain any silly
     # mistakes. It would be nice to have a more thorough test though, e.g.
     # make sure that `notify-send' is called and make sure that we don't
     # fail when `notify-send' does fail.
     program.notify_starting()
     program.notify_finished(Timer())
     program.notify_failed(Timer())
Ejemplo n.º 2
0
 def test_notifications(self):
     """Test the desktop notification functionality."""
     timer = Timer()
     program = RsyncSystemBackup(destination='/backups/system')
     # The happy path.
     with MockedProgram('notify-send', returncode=0):
         program.notify_starting()
         program.notify_finished(timer)
         program.notify_failed(timer)
     # The sad path (should not raise exceptions).
     with MockedProgram('notify-send', returncode=1):
         program.notify_starting()
         program.notify_finished(timer)
         program.notify_failed(timer)