Šarūnas Nejus
cb82917fe0
Replace assertFalse
2024-08-12 08:43:41 +01:00
Šarūnas Nejus
0ecc345143
Replace assertTrue
2024-08-05 17:11:16 +01:00
Šarūnas Nejus
fcff5d72af
Remove def suite TestLoader definitions
2024-07-28 18:58:51 +01:00
Šarūnas Nejus
b64eaeda0a
Rename LibTestCase to ItemInDBTestCase
2024-07-28 18:58:34 +01:00
Šarūnas Nejus
3e278159ed
Dedupe TestHelper and _common.TestCase setup
2024-07-28 18:58:33 +01:00
Lars Kruse
508d28f66b
tests: move reusable test-related modules into the beets package
...
External Python packages interfacing beets may want to use an in-memory
beets library instance for testing beets-related code.
The `TestHelper` class is very helpful for this purpose.
Previously `TestHelper` was located in the `test/` directory.
Now it is part of `beets` itself (`beets.test.helper.TestHelper`) and
can be easily imported.
2024-01-15 19:40:57 +01:00
wisp3rwind
1c6113694d
fixup noqa after black auto-formatting
2023-10-22 10:22:09 +02:00
Serene-Arc
a6e5201ff3
Apply formatting tools to all files
...
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Adrian Sampson
af0df4ca03
Missed a couple of cases in tests
2023-07-31 10:26:59 -07:00
Andrew Rogl
1ec87a3bdd
pyupgrade beetsplug and tests
...
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Adrian Sampson
492ff7359a
Set up date tests for #2652
2018-02-20 22:57:58 -05:00
euri10
6664b656f4
Merge branch 'relativedate'
...
Solved conflicts with upstream of new parse classmethod of DateQuery
# Conflicts:
# beets/dbcore/query.py
2017-06-15 08:59:43 +02:00
discopatrick
291b287f56
Add a test for a non-range date query
2017-06-05 16:31:37 +01:00
discopatrick
e1101d4e95
Update assertion with correct error name
2017-06-01 12:33:23 +01:00
discopatrick
fbb868e5ed
Merge branch 'master' into query-datetime-parser
2017-06-01 04:37:45 +01:00
discopatrick
50a2e37a4d
Keep function names lowercase to pass flake8 tests
2017-04-27 15:58:08 +01:00
discopatrick
6e6dd76513
Remove space separator tests from test_x_precision_intervals tests
...
This is not the correct place for space separator tests. Each test
should test one thing only. Space separator tests are now in a separate
test case.
2017-04-27 11:36:03 +01:00
discopatrick
5a3b74f681
Test an invalid datetime separator raises error
2017-04-27 11:29:45 +01:00
discopatrick
1ab913b200
Test each valid datetime separator
2017-04-27 11:28:10 +01:00
discopatrick
24890c77f1
Add a date query precision of ‘second’
2017-04-27 00:24:17 +01:00
discopatrick
02bd19fb32
Allow minute precision queries to use space separator
2017-04-27 00:06:36 +01:00
discopatrick
c3771f722c
Allow hour precision queries to use space separator
2017-04-27 00:04:46 +01:00
discopatrick
b8e1c5675e
Fix tests
2017-04-25 02:25:50 +01:00
discopatrick
ba324df0d1
Add a date query precision of ‘minute’
2017-04-25 01:38:31 +01:00
discopatrick
5f2c47ec18
Test further hour precision intervals
2017-04-25 01:38:31 +01:00
discopatrick
61b832990f
Add a date query precision of ‘hour’
2017-04-25 01:38:24 +01:00
discopatrick
58417526cb
Rename InvalidQueryArgumentTypeError to InvalidQueryArgumentValueError
...
The way we use `InvalidQueryArgumentTypeError` is more akin to a `ValueError` than a `TypeError`. For example, we try to parse a string as an int, float, or date, but the parsing fails - there was nothing wrong with the type of the variable (string), but its contents were not parseable into the type we wanted - there was a problem with the value of the string.
2017-04-22 18:07:30 +01:00
discopatrick
d466f8802c
passes flake8
2017-04-14 14:45:51 +01:00
discopatrick
ed0ea1dee5
tests more invalid date queries
2017-04-14 01:49:58 +01:00
discopatrick
8e6909bf4b
raises error when date string has too many components
2017-04-14 01:32:18 +01:00
discopatrick
1744ca6e88
raises error when dates passed to query as long numbers
2017-04-14 00:40:06 +01:00
euri10
d2cd4c0f21
Change relative date's format to further simplify it
...
A relative date doesn't need to be prefixed by @ anymore.
The relative date pattern now displays named groups.
Digits have been change to [0-9] to avoid other digit characters.
Removed the @ character in tests.
Updated subsequent documentation.
2017-01-31 16:56:03 +01:00
euri10
e4a7d37a6d
implementing changes asked
...
corrected rst
fixed flake8 in test
2017-01-29 11:49:22 +01:00
euri10
d48d1f8e3c
fixed E226 flake8
2017-01-29 03:54:10 +01:00
euri10
af679de8ec
using a pattern may avoid copy-paste error when used 3 times after
...
fixed an error with the weeks that didn't use the sign correctly
added more tests, this is where py.test fixtures would shine
2017-01-29 03:51:24 +01:00
euri10
3e76c219fb
without dateutil
2017-01-28 22:39:37 +01:00
euri10
2b89b90ab6
tests flake8 fixed I think finally
2017-01-28 21:47:01 +01:00
euri10
8d054f3656
tests flake8 issues
...
added some doc
2017-01-28 21:40:26 +01:00
euri10
868746bb51
tests
2017-01-28 21:23:03 +01:00
Adrian Sampson
a88682e7bb
Undo from _common import unittest indirection
...
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
2016-11-26 18:46:44 -05:00
Adrian Sampson
71b9fd785c
Revert "Do __name__ comparison with bytes and not unicode"
...
This reverts commit 9c41c39913 .
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Jack Wilsdon
b1c58e99ec
Update code to match pep8 naming standards
2016-04-27 20:15:10 +01: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
5fda42c838
Removed unicode_literals from test_datequery
2016-02-22 09:08:54 +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
Bruno Cauet
53c21330c2
All tests use unicode_literals
2015-01-20 15:58:02 +01:00
Bruno Cauet
9c41c39913
Do __name__ comparison with bytes and not unicode
2015-01-20 12:03:57 +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