Commit graph

26 commits

Author SHA1 Message Date
Adrian Sampson
07242f65e2 Convert always uses bytestring args (#1461) 2015-05-19 16:38:08 -07:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
2dab8e5fd6 Import unicode_literals in beets package 2015-01-19 21:41:33 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Adrian Sampson
b15102608c Fix convert tests
Use some shell trickery to get the pipelined command to work.
2014-12-21 09:50:57 -05:00
Thomas Scholtes
56aba87fdc convert: Test skip existing files
Reproduces #970
2014-09-18 17:01:17 +02:00
Thomas Scholtes
9a732fbd26 Converted files are tagged and checked in tests
The conversion function either copies files or runs the conversion
command on them, depending on the result of the `should_transcode()`
function. This commit makes the tests more sensitive to these cases.
2014-09-14 12:17:05 +02:00
Thomas Scholtes
9e9f645e59 convert: add cli flag to skip confirmation
The flag mirrors the `--yes` flag from the modify command.
2014-09-14 11:46:24 +02:00
Thomas Scholtes
75a28de543 Extend and refactor 'never_convert_lossy_files' tests
* Each test function only uses on fixture, so we create fixtures in the
  test functions and not in the `setup()` method.

* We test the effect of the option set to true and false.
2014-09-14 11:35:01 +02:00
Thomas Scholtes
a37cabb969 Make 'never_convert_lossy_files' tests more meaningful
We should expect the original file extensions to be preserved since we
do not transcode lossy files. The tests now fail, but a fix is coming
up.
2014-09-14 11:17:43 +02:00
Simon Kohlmeyer
ee6f3dba1b fix coding style errors 2014-09-13 19:51:23 +02:00
Simon Kohlmeyer
9d55179d2d Added never_convert_lossy_files option to convert plugin
When set to true, this config option chooses copying over converting when the
source file is in a lossy format. At the moment, everything except ape, flac,
alac and wav is considered lossy.
2014-09-13 19:07:25 +02:00
Thomas Scholtes
29e4fde571 convert: Simplify format configuration.
We don't have to specify the extension. By default it is the same as
the format name.
2014-08-05 12:06:35 +02:00
Thomas Scholtes
b27409684e convert: Add --format option
This option allows the user to specify the format on the command line
instead of editing the configuration.

The commit also includes some refactoring. In particular adding
arguments to functions to avoid dependence on global state.

Doc and Changelog in next commit
2014-08-05 10:45:32 +02:00
Thomas Scholtes
f19fa1567e Test converter embeds album art 2014-06-02 17:09:16 +02:00
Adrian Sampson
77af4ce040 more test isolation (#670)
Doing test-specific cleanup in tearDown before general sandbox deletion helps
avoiding contamination of global state between tests when cleanup fails.

Current Windows status:

    Ran 1106 tests in 72.373s
    FAILED (SKIP=10, errors=13, failures=15)

Closer!
2014-04-13 13:57:22 -07:00
Adrian Sampson
7639267f8f Pythonic names for test helpers 2014-04-12 11:24:47 -07:00
Thomas Scholtes
65fcb8a28c Allow CLI tests to use :memory: db
This significantly increases performance
2014-04-12 16:08:57 +02:00
Thomas Scholtes
9d9f1b539f More robust tests for converted files 2014-04-09 20:41:58 +02:00
Thomas Scholtes
43f94ab7e6 Test convert on import 2014-04-08 01:22:02 +02:00
Thomas Scholtes
6eb497b21b Remove pathlib dependency 2014-04-07 18:33:12 +02:00
Thomas Scholtes
651bdf0acc Refactor convert plugin
* `encode()` raises an error when the command returns with non-zero exit
  status. We catch that in the higher-level conversion functions and skip to
  the next item without writing tags.

* Simplified the handling of the `keep_new` flag.
2014-04-07 18:24:59 +02:00
Thomas Scholtes
9d87a7fc02 Make convert --keep-new work again
Iincludes some more tests for the convert plugin. The test use the extended
TestHelper class and the new pathlib (see #621).
2014-04-07 18:07:43 +02:00
Thomas Scholtes
0a08696add Test convert error during import
When the conversion of an audio file fails during import the original should be
imported. See #659
2014-04-05 21:09:12 +02:00