Commit Graph

700 Commits

Author SHA1 Message Date
Laurent Monin
2d8a1f8136 Unload plugin before each test 2019-04-18 11:14:48 +02:00
Laurent Monin
6bacf2deb4 _get_test_plugins(): Ignore __pycache__ 2019-04-18 11:14:48 +02:00
Laurent Monin
7fceae05f7 Minor warnings fixes 2019-04-18 11:14:48 +02:00
Laurent Monin
1b1800ae75 Clean up plugin test files
- remove extra space in files
- add a MANIFEST.json to dummyplugin.picard.zip (and remove metadata from python file)
2019-04-18 11:14:48 +02:00
Laurent Monin
51e85f6883 PluginManager.install_plugin(): assert path or plugin_name, and test it 2019-04-18 11:14:47 +02:00
Laurent Monin
ae779631c1 Actually import DummyPlugin to ensure it was properly loaded 2019-04-18 11:14:47 +02:00
Laurent Monin
dd42b5e3bd Add tests for zipped plugin installed from picard plugins ws 2019-04-18 11:14:47 +02:00
Laurent Monin
f9cc6c1d81 packaged_module support is not really implemented 2019-04-18 11:14:47 +02:00
Laurent Monin
3634cbb99b TestPicardPluginsInstall: get rid of useless loop 2019-04-18 11:14:47 +02:00
Laurent Monin
f6f7b58c38 Add tests for PluginManager.install_plugin() 2019-04-18 11:14:47 +02:00
Laurent Monin
76487b0b0b Add tests for _plugin_name_from_path() 2019-04-18 11:14:47 +02:00
Laurent Monin
689fcdcc48 Drop PluginManager._api_versions, use picard.api_versions_tuple instead
- modify PluginManager._compatible_api_versions()
- add matching tests
2019-04-18 11:14:46 +02:00
Laurent Monin
45a6b20b85 Introduce picard.api_versions_tuple
- list of versions as tuples
- constant calculated from picard.api_versions
- add tests
- skip tests if not enough elements (previous code didn't make sense anyway)
2019-04-18 11:14:45 +02:00
Philipp Wolfer
dc0ec84401 isort: Consistently use two blank lines after import 2019-04-04 08:35:23 +02:00
Philipp Wolfer
dd4da2aa47 Updated isort config to put test imports in separate section 2019-04-04 08:32:22 +02:00
Philipp Wolfer
05fc98c64a Run isort over all files 2019-04-03 21:19:12 +02:00
Laurent Monin
fb6807636d Add tests for config upgrade functions 2019-04-03 12:22:53 +02:00
Laurent Monin
a63cc6bdd1 Rework config and add tests for it
- get rid of useless ConfigSection.__config
- use name instead of full key (as section name is fixed)
- add support for qt type
- remove _convert_to_bool(), unneeded with qt type support
2019-04-03 09:46:52 +02:00
Laurent Monin
0f1ca5379a Move to DEFAULT_FILE_NAMING_FORMAT to picard.const 2019-04-02 14:06:49 +02:00
Philipp Wolfer
7cf3945272 Removed unused imports 2019-03-29 10:55:28 +01:00
Philipp Wolfer
e41c683c0f Merge pull request #1160 from phw/fix-config-loading
Fix loading BoolOption from config
2019-03-29 09:10:20 +00:00
Philipp Wolfer
63cb114080 Always run tagger.run_cleanup for PicardTestCase 2019-03-29 08:59:14 +00:00
Philipp Wolfer
d0563fa5c4 Extended option test cases 2019-03-29 09:30:09 +01:00
Philipp Wolfer
0405f7acb5 Added tests for config options 2019-03-29 09:06:54 +01:00
Philipp Wolfer
ea9ad532b2 PICARD-1497: Mark invalid Apev2 keys as unsupported tags 2019-03-28 22:52:59 +01:00
Philipp Wolfer
dd12220e1e PICARD-1497: Mark invalid Vorbis keys as unsupported tags 2019-03-28 22:52:59 +01:00
Laurent Monin
0724e8fb26 metadata.delete('tag') -> del metadata['tag'] 2019-03-28 13:39:51 +00:00
Philipp Wolfer
10f896d327 Formats test code cleanup
Addressed review comments
2019-03-28 14:18:14 +01:00
Philipp Wolfer
12548bb638 Added tests for ASF utility functions 2019-03-28 11:45:42 +01:00
Philipp Wolfer
7c7ad564d5 Added tests for ID3 utility functions 2019-03-28 11:45:42 +01:00
Philipp Wolfer
09fe255891 Renamed base test case classes for consistency 2019-03-28 11:45:42 +01:00
Philipp Wolfer
a268b13ceb Refactored cover art file tests into format specific test files 2019-03-28 11:45:42 +01:00
Philipp Wolfer
a1313bef84 PEP8 fixes 2019-03-28 11:45:42 +01:00
Philipp Wolfer
3b3980adb0 Added tests for technical file info tags 2019-03-28 11:45:42 +01:00
Philipp Wolfer
8fdfcf1ffe Restructure format tests into separate files 2019-03-28 11:10:06 +01:00
Philipp Wolfer
ab1adf15cb Add common tests for Vorbis formats 2019-03-27 15:05:47 +01:00
Philipp Wolfer
cf9528bd86 PICARD-1492: Added tests and docs for vorbis.sanitize_key 2019-03-26 16:06:08 +01:00
Philipp Wolfer
2d98026c22 PICARD-1492: Fix saving Vorbis ratings with invalid chars in user e-mail 2019-03-26 09:24:56 +01:00
Philipp Wolfer
3a2cfc3a89 Fix ASFFile._save modifying passed metadata 2019-03-26 07:32:59 +00:00
Philipp Wolfer
601df7b158 Simpified initializing Metadata() in formats tests 2019-03-26 07:32:59 +00:00
Laurent Monin
c80ae1344b Name countries-related tests, classes and variables consistently 2019-03-25 14:40:52 +01:00
Laurent Monin
a458bbe2ff country_list_from_node() -> countries_from_node() 2019-03-25 14:38:51 +01:00
Laurent Monin
5ae92454f4 Add a test for release without events vs countries 2019-03-25 14:36:56 +01:00
Laurent Monin
4983631f70 Merge pull request #1142 from zas/coverimage_metadata_cleanup
CoverArtImage/ImageList/Metadata cleanup
2019-03-24 14:33:50 +01:00
Laurent Monin
b33e59428f Clean up various matching iterations, unify a bit
- use generators for candidates
- introduce picard.util.find_best_match() and sort_by_similarity() with tests
- partially revert change that removed sorted(), it was actually faster and cleaner
- use namedtuples to get rid of numeric indexes
- when no match, output max similarity, threshold and number of candidates to debug log
- make code easier to understand, using long names and namedtuple attributes, and simpler workflow
- use repr(best_match) for debug, as it provides all the needed info
- set values explicitly using namedtuple kw parameters
- use same prefix for namedtuples names, it eases searching through code

Typical debug output looks like:
```
D: 13:16:41,806 cluster._lookup_finished:223: BestMatch(similarity=0.79, result=SimMatchRelease(similarity=0.79, release={'id': '36b8f767-c4c0-4ba1-becd-f40a452303d5', 'score': 79, 'count': 1, 'title': 'Purple', 'status': 'Official', 'packaging': 'Jewel Case', 'text-representation': {'language': 'eng', 'script': 'Latn'}, 'artist-credit': [{'artist': {'id': '8c32bb01-58a3-453b-8050-8c0620edb0e5', 'name': 'Stone Temple Pilots', 'sort-name': 'Stone Temple Pilots'}}], 'release-group': {'id': '01d45519-54a6-3427-b0dc-222203fa5d57', 'type-id': 'f529b476-6e62-324f-b0aa-1f3e33d313fc', 'title': 'Purple', 'primary-type': 'Album'}, 'date': '1995-08-25', 'country': 'US', 'release-events': [{'date': '1995-08-25', 'area': {'id': '489ce91b-6658-3307-9877-795b68554c98', 'name': 'United States', 'sort-name': 'United States', 'iso-3166-1-codes': ['US']}}], 'track-count': 11, 'media': [{'format': 'CD', 'disc-count': 10, 'track-count': 11}]}), num_results=25) < threshold=0.800000
```
2019-03-23 16:29:44 +01:00
Laurent Monin
7e3c9673c8 Add test for Metadata.apply_func() with preserved tags 2019-03-22 11:04:44 +01:00
Laurent Monin
b81947e22d Add test for Metadata.strip_whitespace() 2019-03-22 10:54:31 +01:00
Laurent Monin
99896bff8b Add tests for ImageList copy()/clear()/del
Note: clear() is apparently inherited, i read docs saying otherwise, so i add a test for it to be sure
2019-03-22 10:32:32 +01:00
Laurent Monin
3a44ec41e2 Disable pylint warning about ImageList.insert() 2019-03-22 10:32:32 +01:00
Laurent Monin
9340c6c2ec Drop Metadata.set_front_image(), replace with ImageList.strip_front_images()
- only used in ui/coverartbox.py and not directly linked to metadata
- add tests
-
2019-03-22 10:32:31 +01:00