Browse Source
* isSFVfile(): Checks if given file is a SFV file, and returns result as boolean * Obfuscated SFV files: find and use them * Obfuscated SFV files: rename to is_sfv_file() * is_sfv_file(): regexp based, minor stuff, pytest * is_sfv_file(): pytest according to blackpull/1468/head
committed by
GitHub
7 changed files with 99 additions and 2 deletions
@ -0,0 +1,11 @@ |
|||
; Generated by cksfv v1.3.14 on 2020-05-25 at 17:49.33 |
|||
; Project web site: http://www.iki.fi/shd/foss/cksfv/ |
|||
; |
|||
; 10485760 17:47.45 2020-05-25 normalascanbe.bin |
|||
; 10485760 17:44.36 2020-05-25 schöne_Türen_öffnen |
|||
; 10485760 17:44.05 2020-05-25 this is a file with spaces |
|||
; 10485760 17:47.30 2020-05-25 你好世界 |
|||
normalascanbe.bin 681718CC |
|||
schöne_Türen_öffnen 788E9541 |
|||
this is a file with spaces 24041228 |
|||
你好世界 78938E11 |
@ -0,0 +1 @@ |
|||
My Only File ABCD1234 |
@ -0,0 +1,4 @@ |
|||
; this is a line |
|||
; and this too |
|||
; and more |
|||
; and more ... |
Binary file not shown.
@ -0,0 +1,28 @@ |
|||
# 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_is_sfv_file- Testing SABnzbd is_sfv_file() |
|||
""" |
|||
|
|||
from sabnzbd.newsunpack import is_sfv_file |
|||
|
|||
|
|||
class Test_is_sfv_file: |
|||
""" Tests of is_sfv_file() against various input files |
|||
""" |
|||
|
|||
def test_valid_unicode_sfv(self): |
|||
assert is_sfv_file("tests/data/good_sfv_unicode.sfv") |
|||
|
|||
def test_valid_one_line_sfv(self): |
|||
assert is_sfv_file("tests/data/one_line.sfv") |
|||
|
|||
def test_only_comments(self): |
|||
assert not is_sfv_file("tests/data/only_comments.sfv") |
|||
|
|||
def test_random_bin(self): |
|||
assert not is_sfv_file("tests/data/random.bin") |
Loading…
Reference in new issue