예제 #1
0
파일: tests.py 프로젝트: Gr1N/rpihelper
    def test_transmission_error(self):
        tc = MagicMock()
        tc_add_torrent = raise_exception
        tc.add_torrent = tc_add_torrent

        success = transmissionrpc_add_torrent(tc, 'fake_file')
        self.assertFalse(success)
예제 #2
0
파일: tests.py 프로젝트: Gr1N/rpihelper
    def test_ok(self):
        tc = MagicMock()
        tc_add_torrent = MagicMock()
        tc.add_torrent = tc_add_torrent

        success = transmissionrpc_add_torrent(tc, 'fake_file')
        tc_add_torrent.assert_called_once()
        self.assertTrue(success)