-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 833-improve-docstrings-for-image-and-imageli…
…st-method-convert_to_grayscale
- Loading branch information
Showing
12 changed files
with
410 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/safeds/data/tabular/containers/_temporal_cell/test_century.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import datetime | ||
|
||
import pytest | ||
|
||
from tests.helpers import assert_cell_operation_works | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("expected", "input_date"), | ||
[ | ||
(18, datetime.datetime(1800, 1, 9, 23, 29, 1, tzinfo=datetime.UTC)), | ||
(21, datetime.date(2022, 1, 1)), | ||
], | ||
ids=[ | ||
"ISO datetime", | ||
"ISO date", | ||
], | ||
) | ||
def test_get_day(input_date: datetime.date, expected: bool) -> None: | ||
assert_cell_operation_works(input_date, lambda cell: cell.dt.century(), expected) |
20 changes: 20 additions & 0 deletions
20
tests/safeds/data/tabular/containers/_temporal_cell/test_day.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import datetime | ||
|
||
import pytest | ||
|
||
from tests.helpers import assert_cell_operation_works | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("expected", "input_date"), | ||
[ | ||
(9, datetime.datetime(2022, 1, 9, 23, 29, 1, tzinfo=datetime.UTC)), | ||
(1, datetime.date(2022, 1, 1)), | ||
], | ||
ids=[ | ||
"ISO datetime", | ||
"ISO date", | ||
], | ||
) | ||
def test_get_day(input_date: datetime.date, expected: bool) -> None: | ||
assert_cell_operation_works(input_date, lambda cell: cell.dt.day(), expected) |
20 changes: 20 additions & 0 deletions
20
tests/safeds/data/tabular/containers/_temporal_cell/test_month.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import datetime | ||
|
||
import pytest | ||
|
||
from tests.helpers import assert_cell_operation_works | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("expected", "input_date"), | ||
[ | ||
(3, datetime.datetime(2022, 3, 9, 23, 29, 1, tzinfo=datetime.UTC)), | ||
(1, datetime.date(2022, 1, 1)), | ||
], | ||
ids=[ | ||
"ISO datetime", | ||
"ISO date", | ||
], | ||
) | ||
def test_get_month(input_date: datetime.date, expected: bool) -> None: | ||
assert_cell_operation_works(input_date, lambda cell: cell.dt.month(), expected) |
20 changes: 20 additions & 0 deletions
20
tests/safeds/data/tabular/containers/_temporal_cell/test_week.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import datetime | ||
|
||
import pytest | ||
|
||
from tests.helpers import assert_cell_operation_works | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("expected", "input_date"), | ||
[ | ||
(10, datetime.datetime(2023, 3, 9, 23, 29, 1, tzinfo=datetime.UTC)), | ||
(52, datetime.date(2022, 1, 1)), | ||
], | ||
ids=[ | ||
"ISO datetime", | ||
"ISO date", | ||
], | ||
) | ||
def test_get_week(input_date: datetime.date, expected: bool) -> None: | ||
assert_cell_operation_works(input_date, lambda cell: cell.dt.week(), expected) |
20 changes: 20 additions & 0 deletions
20
tests/safeds/data/tabular/containers/_temporal_cell/test_weekday.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import datetime | ||
|
||
import pytest | ||
|
||
from tests.helpers import assert_cell_operation_works | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("expected", "input_date"), | ||
[ | ||
(4, datetime.datetime(2023, 3, 9, 23, 29, 1, tzinfo=datetime.UTC)), | ||
(6, datetime.date(2022, 1, 1)), | ||
], | ||
ids=[ | ||
"ISO datetime", | ||
"ISO date", | ||
], | ||
) | ||
def test_get_weekday(input_date: datetime.date, expected: bool) -> None: | ||
assert_cell_operation_works(input_date, lambda cell: cell.dt.weekday(), expected) |
20 changes: 20 additions & 0 deletions
20
tests/safeds/data/tabular/containers/_temporal_cell/test_year.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import datetime | ||
|
||
import pytest | ||
|
||
from tests.helpers import assert_cell_operation_works | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("expected", "input_date"), | ||
[ | ||
(2023, datetime.datetime(2023, 3, 9, 23, 29, 1, tzinfo=datetime.UTC)), | ||
(2022, datetime.date(2022, 1, 1)), | ||
], | ||
ids=[ | ||
"ISO datetime", | ||
"ISO date", | ||
], | ||
) | ||
def test_get_year(input_date: datetime.date, expected: bool) -> None: | ||
assert_cell_operation_works(input_date, lambda cell: cell.dt.year(), expected) |
Oops, something went wrong.