7 changed files with 154 additions and 65 deletions
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="iso-8859-1" ?> |
|||
<!DOCTYPE nzb PUBLIC "-//newzBin//DTD NZB 1.0//EN" "http://www.newzbin.com/DTD/nzb/nzb-1.0.dtd"> |
|||
<nzb xmlns="http://www.newzbin.com/DTD/2003/nzb"> |
|||
<file poster="nzbtester5@gmail.com" date="1495557432" subject="RefTestNZB: rar5 8288192_RAR5_FILE.rar ff2f7ca6 - "8288192_RAR5_FILE.rar" yEnc (1/11)"> |
|||
<groups><group>alt.binaries.boneless</group></groups> |
|||
<segments> |
|||
<segment bytes="350593" number="1">YyZUA.55279$4Z1.8096@fx31.am4</segment> |
|||
<segment bytes="350823" number="2">ZyZUA.55280$4Z1.25561@fx31.am4</segment> |
|||
<segment bytes="350639" number="3">ZyZUA.55281$4Z1.11063@fx31.am4</segment> |
|||
<segment bytes="350732" number="4">_yZUA.55282$4Z1.16876@fx31.am4</segment> |
|||
<segment bytes="350700" number="5">_yZUA.55283$4Z1.13779@fx31.am4</segment> |
|||
<segment bytes="350608" number="6">%yZUA.55284$4Z1.46223@fx31.am4</segment> |
|||
<segment bytes="350828" number="7">0zZUA.55285$4Z1.6649@fx31.am4</segment> |
|||
<segment bytes="119105" number="11">2zZUA.55289$4Z1.25108@fx31.am4</segment> |
|||
<segment bytes="350796" number="8">0zZUA.55286$4Z1.37644@fx31.am4</segment> |
|||
<segment bytes="350756" number="9">1zZUA.55287$4Z1.2275@fx31.am4</segment> |
|||
<segment bytes="350656" number="10">2zZUA.55288$4Z1.18213@fx31.am4</segment> |
|||
</segments> |
|||
</file> |
|||
</nzb> |
@ -0,0 +1,58 @@ |
|||
#!/usr/bin/python -OO |
|||
# Copyright 2008-2017 The SABnzbd-Team <team@sabnzbd.org> |
|||
# |
|||
# This program is free software; you can redistribute it and/or |
|||
# modify it under the terms of the GNU General Public License |
|||
# as published by the Free Software Foundation; either version 2 |
|||
# of the License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with this program; if not, write to the Free Software |
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|||
|
|||
""" |
|||
tests.test_nzb - Basic NZB adding support |
|||
""" |
|||
|
|||
import os |
|||
import pytest |
|||
import testhelper |
|||
|
|||
|
|||
# Where are we now? |
|||
base_path = os.path.dirname(os.path.abspath(__file__)) |
|||
|
|||
|
|||
def nzo_in_queue(nzo_response): |
|||
""" Helper function for checking if file is in queue and then remove it """ |
|||
queue_res = testhelper.get_api_result('queue') |
|||
nzo_id = nzo_response['nzo_ids'][0] |
|||
|
|||
# Was it added? |
|||
assert nzo_response['status'] == True |
|||
assert queue_res['queue']['slots'][0]['nzo_id'] == nzo_response['nzo_ids'][0] |
|||
|
|||
# Let's remove it |
|||
remove_response = testhelper.get_api_result('queue', {'name': 'delete', 'value': nzo_id}) |
|||
assert nzo_response['status'] == True |
|||
|
|||
# Really gone? |
|||
queue_res = testhelper.get_api_result('queue') |
|||
assert not queue_res['queue']['slots'] |
|||
|
|||
|
|||
def test_addfile(sabnzbd_connect): |
|||
# See if basic upload works |
|||
nzo_response = testhelper.upload_nzb(os.path.join(base_path, 'data', 'reftestnzb.nzb')) |
|||
nzo_in_queue(nzo_response) |
|||
|
|||
|
|||
def test_addlocalfile(sabnzbd_connect): |
|||
# See if basic adding from disk-file works |
|||
nzo_response = testhelper.get_api_result('addlocalfile', {'name': os.path.join(base_path, 'data', 'reftestnzb.nzb')}) |
|||
nzo_in_queue(nzo_response) |
Loading…
Reference in new issue