158 Commits

Author SHA1 Message Date
Bob Swift
9ac7fd290b Add tests for new functions. 2020-01-30 19:31:41 -07:00
Philipp Wolfer
2c35d76b75 PICARD-1667: Functions for boolean checks must return "" on False 2019-11-12 11:47:42 +01:00
Philipp Wolfer
d304e30dc2 PICARD-1594: Set ~video variable on file loading based on extension
This does not give a 100% coverage of detecting files which include video, but at least those files are supposed to be video files.
2019-09-11 08:49:00 +02:00
Philipp Wolfer
6ba10be54b PICARD-1594: Add $is_video() and $is_audio() scripting functions 2019-09-10 17:45:58 +02:00
Philipp Wolfer
a66b66d3d4 Increased test coverage for scripting tests 2019-09-07 20:54:12 +02:00
Philipp Wolfer
d34cf8147b PICARD-1556: Added line breaks to file naming script for readability 2019-08-05 15:18:45 +02:00
Philipp Wolfer
3c5f1114a8 PICARD-1517: Fix running matchedtracks()/is_complete() on clusters 2019-05-31 06:05:10 +00:00
Laurent Monin
2848b76f1c Improve script tests: use assertRaisesRegex() and remove useless self.fail()
Suggested by Mineo
2019-04-25 14:14:45 +02:00
Laurent Monin
437c55ea2e Make wrong number of arguments script error message more explicit, along tests 2019-04-19 10:05:21 +02:00
Philipp Wolfer
dd4da2aa47 Updated isort config to put test imports in separate section 2019-04-04 08:32:22 +02:00
Laurent Monin
0f1ca5379a Move to DEFAULT_FILE_NAMING_FORMAT to picard.const 2019-04-02 14:06:49 +02:00
Philipp Wolfer
3ec9c7c5e4 Merge pull request #1023 from phw/PICARD-637-fix-matchedtracks
PICARD-637: Allow $matchedtracks any number of args
2018-10-31 08:33:46 +01:00
virusMac
8cc47a7680 PICARD-862: Add tests for func_pad, func_replace, func_strip (#1022) 2018-10-31 08:33:02 +01:00
Philipp Wolfer
b18fbc77b2 Added tests for $matchedtracks 2018-10-29 13:34:02 +01:00
virusMac
3310f9914e PICARD-1386: Add $title function (#1018)
PICARD-1386: Add $title function
2018-10-29 08:34:54 +01:00
Wieland Hoffmann
e624aa121c Make PicardTestCase the parent class of all tests
This brings the faketagger and, more importantly, settings reset to all of them.
2018-10-23 17:32:50 +02:00
Laurent Monin
5329e3592a Clean up and sort imports using isort
Add a config for isort (https://github.com/timothycrosley/isort)
Run isort -rc . and make import style consistent across files
Add a note about `isort` in CONTRIBUTING.md
2018-08-22 08:51:25 +02:00
Sophist
c067bd5e26 Merge branch 'master' into PICARD-922_improve-inmulti-as-per-1.4.1 2017-05-11 08:26:15 +01:00
Sophist
303cf79390 Use assertScriptResultEquals...
... instead of assertEqual(self.parser.eval
2017-05-03 09:09:27 +01:00
Wieland Hoffmann
05b343a232 Reject functions with required keyword-only arguments
Python 3 / PEP3102 introduced keyword-only arguments, like in

  def foo(a, *, b):
    pass

where `b` can't be set as a positional argument. This can't be expressed in
tagger script, so reject calls to register such functions.

This also gets rid of a DeprecationWarning for inspect.getargspec.

Signed-off-by: Wieland Hoffmann <themineo@gmail.com>
2017-05-01 18:27:07 +02:00
Sophist
9bb4802144 Add explanatory comments 2017-05-01 13:50:35 +01:00
Sophist
f4ce8e2ca6 Add tests for override with standard sep 2017-05-01 13:44:33 +01:00
Sophist
fca5061a11 Add seperator override tests for $lenmulti 2017-05-01 13:36:29 +01:00
Sophist
64e3c89180 Fix bug with default separator overridden. 2017-05-01 13:28:56 +01:00
Sophist
602dfbb36e Add $lenmulti function 2017-04-29 14:01:50 +01:00
Sophist
60983a2a22 Fix copymerge
1. Newsvals deduped
2. Oldvals in original sequence
2017-04-29 14:01:50 +01:00
Sophist
0b4b14ce9c Fix $inmulti as per #623 2017-04-29 14:01:22 +01:00
Wieland Hoffmann
a749e996e7 Remove unused imports 2017-04-17 18:14:46 +02:00
Wieland Hoffmann
06dd81b78e Move the self.assertEqual(self.parser.eval(...), ...) pattern to a function 2017-04-17 18:14:20 +02:00
Sambhav Kothari
b0fcc9eedf Fix test_script 2017-04-07 16:06:15 +05:30
Sambhav Kothari
428e168b87 Port Picard to Qt5 2017-04-03 16:45:42 +05:30
Laurent Monin
1013cd5ed7 Revert "PICARD-922: Fix inmulti behaviour with multi-values" 2017-02-15 11:38:35 +01:00
Antonio Larrosa
b7c324b4de Fix PEP8 issues (mostly lines too large)
Add a few empty lines and wrap some lines so they're not so large
2017-02-13 15:41:20 +01:00
Antonio Larrosa
85282935f6 Add test for the inmulti function
Add a test to check that the inmulti function works as expected.
2017-02-12 20:47:15 +01:00
Sambhav Kothari
2ed4fbe8d4 Add tests for startswith and endswith functions 2017-01-19 02:18:09 +05:30
Laurent Monin
6cc8ebce72 Merge pull request #549 from samj1912/picard384
PICARD-384: Allow wildcards for unsetting certain tags
2017-01-14 15:44:36 +01:00
Sambhav Kothari
69c4abe2b5 Add tests for arbitrary number of arguments 2017-01-13 22:06:59 +01:00
Sambhav Kothari
d028418d2e Add more tests for unset script function 2017-01-13 03:24:06 +05:30
Sambhav Kothari
fe65394c88 Add tests for unset script function 2017-01-13 03:06:55 +05:30
Philipp Wolfer
c6446626aa Better fix for script functions with zero arguments. 2014-06-25 22:08:10 +02:00
Sophist
08ca42e90f Add non-NAT and NAT tests 2014-05-14 07:40:11 +01:00
Sophist
dd03540f15 Add eq_all, ne_any as requested by Freso 2014-04-18 15:44:11 +01:00
Sophist
9291fcbb46 Add tests 2014-04-18 15:43:13 +01:00
Laurent Monin
7dd311697f tests: PEP8 fixes 2013-07-03 03:37:24 +02:00
Michael Wiencek
d5509680ab Fix tests 2013-06-09 01:45:18 -05:00
Chad Wilson
76faa5b8d7 $setlist -> $setmulti (dont refer to internal data structure in name) 2012-01-20 01:07:06 +08:00
Chad Wilson
38061aeda9 Changed to do nothing on an empty splitter; ValueErrors in the log are annoying. 2012-01-20 00:55:30 +08:00
Chad Wilson
cdddc819bc failUnless -> assert (impending deprecation) 2012-01-20 00:41:58 +08:00
Chad Wilson
4cda132ad1 Add more tests for set and setlist 2012-01-20 00:40:32 +08:00
Chad Wilson
90dc12e19a Add tests for $copy, $copymerge; improve test for $get. 2012-01-11 00:33:52 +08:00