Commit graph

24 commits

Author SHA1 Message Date
Šarūnas Nejus
85a17ee503
Reformat the codebase 2024-09-21 11:57:48 +01:00
Šarūnas Nejus
847e3858a6
Replace assertRaises 2024-08-12 08:43:42 +01:00
Šarūnas Nejus
9a05d27acf
Replace assertEqual 2024-08-12 08:43:42 +01:00
Š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
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
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
wisp3rwind
5de1d12610 tests: address some warnings
- some helper functions were incorrectly detected as being tests due to
  their name
- use of the deprecated assertEquals alias
2023-05-07 18:43:43 +02:00
J0J0 Todos
99231160a7 convert: playlist: M3U read as bytes
- M3UFile.read() method reads in rb mode.
- M3UFile.read() method handles removal of (platform specific) line endings.
- Playlist contents and EXTM3U header is handled as bytes.
- Fix test_playlist*read* tests to encode playlist UTF-8 assert strings to
  bytes using bytestring_path() before comparision.
  - Fixture playlist_windows.m3u8 is now actually Windows formatted (\r\n + BOM)
2023-03-29 07:46:08 +02:00
J0J0 Todos
a4d03ef586 convert: playlist: M3U write + contents as bytes
Make sure we stay with the beets standard of handling everything internally as
bytes.

- M3UFile.write() method writes in wb mode.
- Playlist contents and EXTM3U header is handled as bytes.
  - item.destination() gives us unicode string paths, we tranlate to bytes
    using util.bytestring_path().
- Fix test_playlist*write* tests to encode UTF-8 assert strings as bytes using
  bytestring_path() before comparision.
2023-03-29 07:46:08 +02:00
J0J0 T
068208f71e convert: Fix copyright year in test_m3ufile.py 2023-03-29 07:46:08 +02:00
J0J0 T
c28eb95ef2 convert: playlist: Remove debug print winpath
in test.
2023-03-29 07:46:08 +02:00
J0J0 T
ff03ecaa27 convert: playlist: Add another Windows test
Add test_playlist_write_and_read_unicode_windows: Writes 2 media file
paths containing unicode characters, reads them in using M3UFile class
again and tests if the contents is correct.
2023-03-29 07:46:08 +02:00
J0J0 T
39efd23d06 convert: playlist: Fix winpath driveletter in test
Needs to be put including (double) backslash!
2023-03-29 07:46:08 +02:00
J0J0 T
a641fd151e convert: playlist: debug winpath in test 2023-03-29 07:46:08 +02:00
J0J0 T
54d22bea6e convert: playlist: Construct winpath before assert 2023-03-29 07:46:08 +02:00
J0J0 T
31b9e7afeb convert: playlist: Construct Windows path programatically 2023-03-29 07:46:08 +02:00
J0J0 T
004d10a143 convert: playlist: Put actual Windows paths
into fixture file for the Windows unittest.
2023-03-29 07:46:08 +02:00
J0J0 T
bd5335f31f convert: playlist: Separate unicode test for Windows 2023-03-29 07:46:08 +02:00
J0J0 T
2c1163cbc5 convert: playlist: Linter and import fixes
in m3u module and testsuite.
2023-03-29 07:46:08 +02:00
J0J0 T
39e4b90b5c convert: playlist: Add tests checking extm3u and
fix extm3u check in load method.
2023-03-29 07:21:27 +02:00
J0J0 T
68240f6e03 convert: playlist: Add EmptyPlaylistError and test
- Add and Exception class called EmptyPlaylistError ought to be raised
  when playlists without files are loaded or saved.
- Add a test for it in test_m3ufile
- Fix media_files vs. media_list attribute name.
2023-03-29 07:21:27 +02:00
J0J0 T
0cbf91e4d8 convert: playlist: Add test_m3ufile and fixtures
Add several tests checking loading and saving unicode and regular ascii
text playlist files.
2023-03-29 07:21:27 +02:00