Johnny Robeson
f8049e67b4
add test helper method to convert cmd args on py2/3
...
This helper method converts args to bytes on python 2, and args to
strings on python 3
2016-07-25 02:59:41 -04:00
Johnny Robeson
9ab9166c8d
add a lib keyword arg to the run_command test helper
...
Now a `Library` instance can be passed to run_command as a keyword
argument.
2016-07-25 00:43:33 -04:00
Johnny Robeson
7bb649c3b2
remove :memory: library fallback from test run_command
2016-07-25 00:16:09 -04:00
Johnny Robeson
18b57ea022
clear argv before running commands in the test suite
...
Fixes #2123
2016-07-14 03:33:29 -04:00
Johnny Robeson
fa3fe86ac1
remove bytes() wrap from test helper fixture
...
It was already bytes, so this was redundant. It also broke the tests
on windows with py3.
2016-07-05 02:06:13 -04:00
Johnny Robeson
9020dc1f45
use text_string() in a few places for io output
2016-07-02 00:03:46 -04:00
Johnny Robeson
aa0a0a0f22
use util.py3_path for confit and env paths in tests
2016-06-30 22:24:17 -04:00
Adrian Sampson
c532860613
Apply simple type consistency changes from #2096
...
These are the changes from that PR that just enforce the path type invariants
we already want---they're a good idea regardless of Python 3.
2016-06-30 14:22:16 -07:00
Johnny Robeson
ecfda77f5a
bytestringify a few more paths in tests
2016-06-30 00:08:38 -04:00
Johnny Robeson
8c2809f75c
only write StringIO encoding attr on py2
2016-06-24 05:53:56 -04:00
Johnny Robeson
e8afcbe7ec
replace unicode with six.text_type
2016-06-24 05:53:49 -04:00
Johnny Robeson
5f4678e3e8
use StringIO from six
2016-06-23 04:40:18 -04:00
Johnny Robeson
0b17666b55
Revert "check for encoding attr before set in test_helper"
...
This doesn't actually help us, since the property is there, but not
writeable
This reverts commit 4c98edc588 .
2016-06-22 00:51:10 -04:00
Johnny Robeson
4c98edc588
check for encoding attr before set in test_helper
...
This makes it work equivalently in py2 and py3
2016-06-21 23:44:24 -04:00
Johnny Robeson
60a961a751
remove an unnecessary .encode() in create_item_fixture
2016-06-17 01:20:42 -04:00
Johnny Robeson
1088df7242
bytestringify some more paths in test helper
2016-06-16 23:41:21 -04:00
Johnny Robeson
ffa46a185c
bytestring normalization
...
Make sure many/most strings that touch the filesystem are
converted explicitly to bytestrings rather than implictly.
2016-06-13 05:39:09 -04:00
Adrian Sampson
f400a2431e
fetchart: Fix path types on Windows
2016-06-08 10:20:25 -07:00
Adrian Sampson
2f9aa41614
Clean up SQLite connections in test harness
...
Windows complains that we can't remove the test database file if open
connections remain.
2016-06-05 11:56:09 -07:00
Adrian Sampson
1eb03a0de5
Query tests: use normalized paths
...
Match ordinary beets behavior by storing normalized paths in the
database. This matters on Windows, where normalization adds backslashes
and drive letters.
2016-05-31 13:12:32 -07:00
Adrian Sampson
e54c7eec3d
Standardize __future__ imports without parentheses
...
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
a5ce7a2814
Removed import of unicode_literals from testsuite
2016-02-20 14:46:37 +01:00
Jack Wilsdon
12cd5306b7
Update copyright dates to 2016
2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11
added encoding as comment in files
...
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson
a0ff517d17
Guess output encoding from sys.stdout.encoding
...
Rather than using the locale settings. #1419
2015-04-13 11:11:16 -07:00
Bruno Cauet
adec09de96
Fix outdated docstring in test.TestHelper
2015-03-23 19:15:14 +01:00
Bruno Cauet
69786b8538
Fix test.helper.has_program(): encode command
...
subprocess.subprocess.check_call() should receive a byte string command
otherwise it fails with a UnicodeDecodeError on systems with non-ascii
elements in the system path.
Discovered while reviewing PR #1344 .
2015-03-04 15:05:17 +01:00
Bruno Cauet
f1e13cf886
Offer verbose and very verbose modes
...
'verbose' is now an int and not a boolean. '-v' is level 1, '-vv' level
2. In the configuration it can be set with 'verbose: 1' or 'verbose: 2'.
Improve #1244 : auditing current log levels of plugins remains.
2015-02-10 17:13:15 +01:00
Tom Jaspers
3ec44aab3e
Update _types field instead of assigning it
...
Assigning it would override our pre-defined types
(such as `path` in Album._types)
2015-02-06 10:42:46 +01:00
Thomas Scholtes
482008bf1d
Info plugin can filter properties in output
...
Resolves #1287
2015-02-01 21:51:26 +01:00
Tom Jaspers
927a53d59b
Merge pull request #1281 from tomjaspers/configurable-colors
...
Colors are now user configurable.
Conflicts:
beets/ui/__init__.py
beets/ui/commands.py
2015-01-30 13:48:19 +01:00
Tom Jaspers
e7378c77a7
Fix tests to use config['ui']['color'] instead of top-level color
2015-01-29 14:04:37 +01:00
Bruno Cauet
268dcb0008
test.helper.log_capture() unicode handling
...
Except unicode message instead of bytes.
Fix #1253
2015-01-21 19:18:57 +01:00
Bruno Cauet
152e93136b
test._common and test.helper use unicode literals
2015-01-20 15:52:47 +01:00
Bruno Cauet
afb1611cf2
Fix test.helper __future__ imports
2015-01-20 12:51:27 +01:00
Bruno Cauet
02d8e88ef1
Replace all mentions of 'str' with 'bytes'
2015-01-20 12:48:15 +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
Bruno Cauet
8418fb6083
Use a standard logger for the import log
...
The import log now relies on a standard logger, named 'beets.importer'
and configured upon initialization of the import session.
2015-01-12 21:47:44 +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
Bruno Cauet
30f158a95e
Move "from beets import logging" statements
...
Move the import next to other beets-related imports
2015-01-05 10:05:21 +01:00
Bruno Cauet
7df8bef8b7
Update logging imports: logging → beets.logging
2015-01-04 17:02:27 +01:00
Thomas Scholtes
b33d5b577a
Catch exception when program check has non-zero return code
...
See #1175 .
2014-12-29 12:07:57 +01:00
Thomas Scholtes
e2b2a505fc
zero: Can delete embedded images
...
Fixes #1100 .
2014-12-01 17:33:45 +01:00
Adrian Sampson
42228e6d82
Tests: fix unload_plugins
...
Don't mutate the base classes. This was causing plugins to break on the second
test that uses them, since after they were unloaded their class-level fields
were broken (since the modules are not re-loaded).
This makes it more clear than ever that we need to encapsulate plugin loading
state using some manner of PluginManager.
2014-11-24 10:58:32 -08:00
Thomas Scholtes
d0ac66bfe6
Fix oldstyle object initializer for py26
2014-09-18 16:51:11 +02:00
Thomas Scholtes
1e45ba597d
embed_item function does not raise if image file not found
...
Fixes #968
2014-09-18 16:19:05 +02:00
Thomas Scholtes
3fe52a7694
Add test helpers to create database fixtures
2014-09-14 14:16:34 +02:00
Thomas Scholtes
d4f72f62eb
echonest: set types for flexible fields
...
Conflicts:
beetsplug/echonest.py
2014-09-14 12:34:46 +02:00
Thomas Scholtes
89c82dc63d
fetchart: correctly handle path encoding
...
* Ensure that `config.as_str_seq()` returns a list of unicode objects.
* Map these to bytestring paths so we can compare them to other paths.
Fixes #887
2014-09-13 16:49:34 +02:00