Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 826597 Details for
Bug 878715
media-video/vcsi: still depends on dev-python/nose
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
vcsi-nose-to-pytest.patch
vcsi-nose-to-pytest.patch (text/plain), 10.68 KB, created by
Joonas Niilola
on 2022-11-02 06:32:30 UTC
(
hide
)
Description:
vcsi-nose-to-pytest.patch
Filename:
MIME Type:
Creator:
Joonas Niilola
Created:
2022-11-02 06:32:30 UTC
Size:
10.68 KB
patch
obsolete
>diff -Naur a/tests/test_input.py b/tests/test_input.py >--- a/tests/test_input.py 2022-11-01 12:27:52.162621909 -0000 >+++ b/tests/test_input.py 2022-11-01 12:55:04.702861224 -0000 >@@ -1,10 +1,6 @@ > from argparse import ArgumentTypeError > from unittest.mock import patch, Mock, PropertyMock, MagicMock > >-from nose.tools import assert_equals >-from nose.tools import assert_not_equals >-from nose.tools import assert_raises >- > from vcsi.vcsi import Grid, mxn_type, Color, hex_color_type, manual_timestamps, timestamp_position_type, \ > TimestampPosition, comma_separated_string_type, metadata_position_type, cleanup, save_image,\ > compute_timestamp_position, max_line_length, draw_metadata >@@ -14,20 +10,20 @@ > def test_grid_default(): > test_grid = mxn_type('4x4') > >- assert_equals(test_grid.x, 4) >- assert_equals(test_grid.y, 4) >+ assert test_grid.x == 4 >+ assert test_grid.y == 4 > > > def test_grid_equality(): > g1 = Grid(4, 4) > g2 = Grid(4, 4) >- assert_equals(g1, g2) >+ assert g1 == g2 > > > def test_grid_inequality(): > g1 = Grid(4, 4) > g2 = Grid(3, 4) >- assert_not_equals(g1, g2) >+ assert g1 != g2 > > > def test_grid_columns_integer(): >@@ -61,13 +57,13 @@ > > > def test_hex_color_type(): >- assert_equals(Color(*(0x10, 0x10, 0x10, 0xff)), hex_color_type("101010")) >+ assert Color(*(0x10, 0x10, 0x10, 0xff)) == hex_color_type("101010") > >- assert_equals(Color(*(0x10, 0x10, 0x10, 0x00)), hex_color_type("10101000")) >+ assert Color(*(0x10, 0x10, 0x10, 0x00)) == hex_color_type("10101000") > >- assert_equals(Color(*(0xff, 0xff, 0xff, 0xff)), hex_color_type("ffffff")) >+ assert Color(*(0xff, 0xff, 0xff, 0xff)) == hex_color_type("ffffff") > >- assert_equals(Color(*(0xff, 0xff, 0xff, 0x00)), hex_color_type("ffffff00")) >+ assert Color(*(0xff, 0xff, 0xff, 0x00)) == hex_color_type("ffffff00") > > assert_raises(ArgumentTypeError, hex_color_type, "abcdeff") > >@@ -75,19 +71,19 @@ > > > def test_manual_timestamps(): >- assert_equals(manual_timestamps("1:11:11.111,2:22:22.222"), ["1:11:11.111", "2:22:22.222"]) >+ assert manual_timestamps("1:11:11.111,2:22:22.222") == ["1:11:11.111", "2:22:22.222"] > > assert_raises(ArgumentTypeError, manual_timestamps, "1:11:a1.111,2:22:b2.222") > > assert_raises(ArgumentTypeError, manual_timestamps, "1:1:1:1.111,2:2.222") > >- assert_equals(manual_timestamps(""), []) >+ assert manual_timestamps("") == [] > > > def test_timestamp_position_type(): >- assert_equals(timestamp_position_type("north"), TimestampPosition.north) >+ assert timestamp_position_type("north") == TimestampPosition.north > >- assert_not_equals(timestamp_position_type("south"), TimestampPosition.north) >+ assert timestamp_position_type("south") != TimestampPosition.north > > assert_raises(ArgumentTypeError, timestamp_position_type, "whatever") > >@@ -95,21 +91,21 @@ > @patch("vcsi.vcsi.parsedatetime") > def test_interval_type(mocked_parsedatatime): > mocked_parsedatatime.return_value = 30 >- assert_equals(mocked_parsedatatime("30 seconds"), 30) >+ assert mocked_parsedatatime("30 seconds") == 30 > > mocked_parsedatatime.assert_called_once_with("30 seconds") > > > def test_comma_separated_string_type(): >- assert_equals(comma_separated_string_type("a, b, c"), ["a", "b", "c"]) >+ assert comma_separated_string_type("a, b, c") == ["a", "b", "c"] > >- assert_equals(comma_separated_string_type("a b, c"), ["a b", "c"]) >+ assert comma_separated_string_type("a b, c") == ["a b", "c"] > > > def test_metadata_position_type(): >- assert_equals(metadata_position_type("top"), "top") >+ assert metadata_position_type("top") == "top" > >- assert_equals(metadata_position_type("TOP"), "top") >+ assert metadata_position_type("TOP") == "top" > > assert_raises(ArgumentTypeError, metadata_position_type, "whatever") > >@@ -130,7 +126,7 @@ > def test_save_image(mocked_Image): > args = PropertyMock() > output_path = "whatever" >- assert_equals(True, save_image(args, mocked_Image, None, output_path)) >+ assert True == save_image(args, mocked_Image, None, output_path) > > mocked_Image.convert().save.assert_called_once() > >@@ -145,17 +141,17 @@ > rectangle_hpadding, rectangle_vpadding = 5, 5 > > args.timestamp_position = TimestampPosition.west >- assert_equals(((1010, 500.0), (1030, 520.0)), >+ assert (((1010, 500.0), (1030, 520.0)) == > compute_timestamp_position(args, w, h, text_size, desired_size, rectangle_hpadding, > rectangle_vpadding)) > > args.timestamp_position = TimestampPosition.north >- assert_equals(((1000, 510.0), (1020, 530.0)), >+ assert (((1000, 510.0), (1020, 530.0)) == > compute_timestamp_position(args, w, h, text_size, desired_size, rectangle_hpadding, > rectangle_vpadding)) > > args.timestamp_position = None >- assert_equals(((990, 490), (1010, 510)), >+ assert (((990, 490), (1010, 510)) == > compute_timestamp_position(args, w, h, text_size, desired_size, rectangle_hpadding, > rectangle_vpadding)) > >@@ -168,19 +164,19 @@ > width = 1000 > > text = "A long line of text" >- assert_equals(19, max_line_length(media_info, metadata_font, header_margin, width, text)) >+ assert 19 == max_line_length(media_info, metadata_font, header_margin, width, text) > > text = "A long line of text with a few more words" >- assert_equals(41, max_line_length(media_info, metadata_font, header_margin, width, text)) >+ assert 41 == max_line_length(media_info, metadata_font, header_margin, width, text) > > text = "A really long line of text with a lots more words" * 100 >- assert_equals(4900, max_line_length(media_info, metadata_font, header_margin, width, text)) >+ assert 4900 == max_line_length(media_info, metadata_font, header_margin, width, text) > > text = None > filename = PropertyMock() > type(media_info).filename = filename > # media_info.filename = filename >- assert_equals(0, max_line_length(media_info, metadata_font, header_margin, width, text)) >+ assert 0 == max_line_length(media_info, metadata_font, header_margin, width, text) > filename.assert_called_once() > > >@@ -192,18 +188,18 @@ > args.metadata_vertical_margin = 0 > header_lines.__iter__ = Mock(return_value=iter(['text1', 'text2'])) > >- assert_equals(0, draw_metadata(draw, args, >+ assert 0 == draw_metadata(draw, args, > header_lines=header_lines, > header_line_height=0, >- start_height=0)) >+ start_height=0) > draw.text.assert_called() > > > def test_grid(): >- assert_equals("2x2", Grid(2, 2).__str__()) >+ assert "2x2" == Grid(2, 2).__str__() > >- assert_equals("10x0", Grid(10, 0).__str__()) >+ assert "10x0" == Grid(10, 0).__str__() > > def test_color(): >- assert_equals("FFFFFFFF", Color(255, 255, 255, 255).__str__()) >+ assert "FFFFFFFF" == Color(255, 255, 255, 255).__str__() > >diff -Naur a/tests/test_mediainfo.py b/tests/test_mediainfo.py >--- a/tests/test_mediainfo.py 2022-11-01 12:27:52.162621909 -0000 >+++ b/tests/test_mediainfo.py 2022-11-01 12:55:21.499151716 -0000 >@@ -2,9 +2,6 @@ > import argparse > from argparse import ArgumentTypeError > >-from nose.tools import assert_raises >-from nose.tools import assert_equals >- > from vcsi.vcsi import MediaInfo > from vcsi.vcsi import Grid, grid_desired_size > from vcsi.vcsi import timestamp_generator >@@ -25,40 +22,40 @@ > > def test_compute_display_resolution(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) >- assert_equals(mi.display_width, 1920) >- assert_equals(mi.display_height, 1080) >+ assert mi.display_width == 1920 >+ assert mi.display_height == 1080 > > > def test_filename(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) >- assert_equals(mi.filename, "bbb_sunflower_1080p_60fps_normal.mp4") >+ assert mi.filename == "bbb_sunflower_1080p_60fps_normal.mp4" > > > def test_duration(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) >- assert_equals(mi.duration_seconds, 634.533333) >+ assert mi.duration_seconds == 634.533333 > > > def test_pretty_duration(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) >- assert_equals(mi.duration, "10:34") >+ assert mi.duration == "10:34" > > > def test_size_bytes(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) >- assert_equals(mi.size_bytes, 355856562) >+ assert mi.size_bytes == 355856562 > > > def test_size(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) >- assert_equals(mi.size, "339.4 MiB") >+ assert mi.size == "339.4 MiB" > > > def test_template_attributes(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) > attributes = mi.template_attributes() >- assert_equals(attributes["audio_codec"], "mp3") >- assert_equals(attributes["video_codec"], "h264") >+ assert attributes["audio_codec"] == "mp3" >+ assert attributes["video_codec"] == "h264" > > > def test_grid_desired_size(): >@@ -71,13 +68,13 @@ > s = grid_desired_size(grid, mi, width=width, horizontal_margin=hmargin) > expected_width = (width - (x-1) * hmargin) / x > >- assert_equals(s[0], expected_width) >+ assert s[0] == expected_width > > > def test_desired_size(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) > s = mi.desired_size(width=1280) >- assert_equals(s[1], 720) >+ assert s[1] == 720 > > > def test_timestamps(): >@@ -96,7 +93,7 @@ > > expected_timestamp = start_delay_percent + 1 > for t in timestamp_generator(mi, args): >- assert_equals(int(t[0]), expected_timestamp) >+ assert int(t[0]) == expected_timestamp > expected_timestamp += 1 > > >@@ -104,21 +101,21 @@ > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) > mi.duration_seconds = 1.9999 > pretty_duration = MediaInfo.pretty_duration(mi.duration_seconds, show_centis=True) >- assert_equals(pretty_duration, "00:01.99") >+ assert pretty_duration == "00:01.99" > > > def test_pretty_duration_millis_limit(): > mi = MediaInfoForTest(FFPROBE_EXAMPLE_JSON_PATH) > mi.duration_seconds = 1.9999 > pretty_duration = MediaInfo.pretty_duration(mi.duration_seconds, show_millis=True) >- assert_equals(pretty_duration, "00:01.999") >+ assert pretty_duration == "00:01.999" > > > def test_pretty_to_seconds(): >- assert_equals(MediaInfo.pretty_to_seconds("1:11:11.111"), 4271.111) >+ assert MediaInfo.pretty_to_seconds("1:11:11.111") == 4271.111 > >- assert_equals(MediaInfo.pretty_to_seconds("1:11:11"), 4271) >+ assert MediaInfo.pretty_to_seconds("1:11:11") == 4271 > >- assert_equals(MediaInfo.pretty_to_seconds("1:01:00"), 3660) >+ assert MediaInfo.pretty_to_seconds("1:01:00") == 3660 > > assert_raises(ArgumentTypeError, MediaInfo.pretty_to_seconds, "1:01:01:01:00")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 878715
: 826597