Commit Graph

277 Commits

Author SHA1 Message Date
Laurent Monin
e2ed569233 Python3 doesn't need to import print_function
This is now a standard feature and no longer needs to be imported from __future__.

https://www.python.org/dev/peps/pep-3105/
2018-02-05 14:43:55 +01:00
Laurent Monin
8df1e78af4 Move throttling code to its own file
API is modified to use methods to get/set delays, instead of setting global variables
2018-01-29 18:24:56 +01:00
Laurent Monin
90ce834eab Use Python3 super()
https://www.python.org/dev/peps/pep-3135/
https://docs.python.org/3.5/library/functions.html#super
https://rhettinger.wordpress.com/2011/05/26/super-considered-super/
2018-01-26 09:18:59 +01:00
Laurent Monin
7a36f8c5f4 Sort dicts by key so it is easier to find something 2018-01-25 18:40:45 +01:00
Laurent Monin
136e3a9e7a Remove duplicate key 'artist' in tags dicts
This is there since 10 years, appeared with cfe5299a76
2018-01-25 18:34:04 +01:00
Laurent Monin
2f1e58c56e Remove duplicate key 'album' in tags dicts
This is there since 10 years, appeared with cfe5299a76
2018-01-25 18:31:39 +01:00
Wieland Hoffmann
c18ae092ba Fix length_score and add tests
In 2f8496e, 1.0 - ... turned into 0.0. Fix that.
2018-01-18 20:58:32 +01:00
Wieland Hoffmann
8490422384 PICARD-1159: Don't pass filenames as bytes to wave.open
wave.open treats everything that's not a str as a file-like object.
encode_filename returns bytes, but they're not file-like.
2017-12-06 19:19:34 +01:00
Sambhav Kothari
b0d412169c Add null type tests 2017-07-26 16:12:12 +05:30
Sambhav Kothari
844eca9eaa Fix null type errors and add test data for null types 2017-07-26 16:09:34 +05:30
Laurent Monin
4f328dba79 LabelInfoTest: reduce code redundancy 2017-07-25 15:48:47 +02:00
Laurent Monin
5aa025619e Fix null catalog-number and/or label cases, add matching tests 2017-07-25 15:41:03 +02:00
Sambhav Kothari
98ae6f777d Fix windows tests 2017-07-24 23:51:00 +05:30
Sambhav Kothari
0f7c066211 Add API helper tests 2017-07-23 17:17:21 +05:30
Sambhav Kothari
506d59e5c6 PICARD-1119: Fix wrong metadata parsing
Fixes https://tickets.metabrainz.org/browse/PICARD-1119
2017-07-22 01:46:53 +05:30
Sambhav Kothari
83e423f0a2 Fix tests with new POST refactoring 2017-07-20 21:34:31 +05:30
Sambhav Kothari
d3edb87f53 Fix WS tests for the new changes 2017-07-20 20:07:46 +05:30
Sambhav Kothari
aaae132e7e Test browser lookup utils 2017-07-18 16:34:54 +05:30
Sambhav Kothari
9062a69c1b Add acoustid json parser test 2017-07-18 15:24:34 +05:30
Sambhav Kothari
22586506cc Fix tests and add test data 2017-07-16 18:33:08 +05:30
Sambhav Kothari
43a33c5f03 Add more test data 2017-07-13 17:04:27 +05:30
Sambhav Kothari
c694872d25 Clean up and refactor mbjson test 2017-07-13 16:58:12 +05:30
Sambhav Kothari
ee8a56b48d Add tests for mbjson 2017-07-13 16:58:12 +05:30
Sambhav Kothari
21d4432096 Fix MB-JSON erronous code 2017-07-13 16:58:12 +05:30
Sambhav Kothari
029a6882e1 Add more tests for the webservice 2017-07-13 16:42:57 +05:30
Wieland Hoffmann
452a78aaf6 Don't use assert_called
It's only available in Python 3.6+
2017-07-10 20:34:16 +02:00
Wieland Hoffmann
690e385255 Use unittest.mock instead of mock
mock is not part of the standard library, only unittest.mock is.
2017-07-10 20:26:35 +02:00
Sambhav Kothari
9df404172a Add more tests for WebService 2017-07-10 15:58:49 +05:30
Sambhav Kothari
dcaa3f4e84 Add basic code to test Webservice 2017-07-09 21:37:52 +05:30
Sophist
b94680e09c Rename variables redefining builtins - test_textencoding.py 2017-05-18 11:30:38 +01:00
Laurent Monin
774229c9a1 Merge pull request #740 from Sophist-UK/Remove-unused-variables
Remove unused variables
2017-05-17 17:05:02 +02:00
Sophist
c2c37c8037 Remove unused variables 2017-05-17 15:07:12 +01:00
Sophist
bf4c08e004 Remove unneeded imports in test files 2017-05-17 11:02:24 +01:00
Laurent Monin
e905a5f716 Merge pull request #709 from Sophist-UK/PICARD-1075_Add-unit-tests-for-Metadata-object-variables
PICARD-1075: Add unit tests for Metadata object variables
2017-05-11 11:07:06 +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
samj1912
094eff232c Merge branch 'master' into fix-mutable 2017-05-10 19:08:50 +05:30
samj1912
11ac00d153 Merge branch 'master' into ibmi 2017-05-10 18:01:02 +05:30
Sambhav Kothari
d03c66033e Avoid mutable default arguments 2017-05-10 17:23:02 +05:30
Sambhav Kothari
93c46dbce8 Update version_to_string to follow PEP440 2017-05-09 14:53:30 +05:30
Shen-Ta Hsieh
d0d9711a37 Update test/data/mb.png size for test_png
Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
2017-05-05 17:54:13 +08:00
Shen-Ta Hsieh
a3f74679e1 Recompress all png files
Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
2017-05-05 16:57:30 +08: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