コード例 #1
0
 def test_prepare_msg(self):
     emitter = dnf.automatic.emitter.Emitter('myhost')
     emitter.notify_available('packages...')
     emitter.notify_downloaded()
     with mock.patch('dnf.automatic.emitter.DOWNLOADED',
                     'downloaded on %s:'):
         self.assertEqual(emitter._prepare_msg(), MSG)
コード例 #2
0
ファイル: test_emitter.py プロジェクト: mavit/dnf
 def test_motd(self):
     m = mock_open()
     with mock.patch('dnf.automatic.emitter.open', m, create=True):
         emitter = dnf.automatic.emitter.MotdEmitter('myhost')
         emitter.notify_available('packages...')
         emitter.notify_downloaded()
         with mock.patch('dnf.automatic.emitter.DOWNLOADED', 'downloaded on %s:'):
             emitter.commit()
         handle = m()
         handle.write.assert_called_once_with(MSG)
コード例 #3
0
ファイル: test_emitter.py プロジェクト: yurchor/dnf
 def test_motd(self):
     m = mock_open()
     with mock.patch('dnf.automatic.emitter.open', m, create=True):
         emitter = dnf.automatic.emitter.MotdEmitter('myhost')
         emitter.notify_available('packages...')
         emitter.notify_downloaded()
         with mock.patch('dnf.automatic.emitter.DOWNLOADED',
                         'downloaded on %s:'):
             emitter.commit()
         handle = m()
         handle.write.assert_called_once_with(MSG)
コード例 #4
0
ファイル: test_emitter.py プロジェクト: mavit/dnf
 def test_prepare_msg(self):
     emitter = dnf.automatic.emitter.Emitter('myhost')
     emitter.notify_available('packages...')
     emitter.notify_downloaded()
     with mock.patch('dnf.automatic.emitter.DOWNLOADED', 'downloaded on %s:'):
         self.assertEqual(emitter._prepare_msg(), MSG)