Skip to content
Snippets Groups Projects
Commit 6357486d authored by Felix Kleinert's avatar Felix Kleinert
Browse files

update test to cover all cases #56

parent 442f983d
No related branches found
No related tags found
2 merge requests!59Develop,!46Felix #56 advanced paddings
Pipeline #30951 passed
......@@ -29,6 +29,22 @@ class TestPadUtils:
PadUtils.get_padding_for_same((1, 1), strides=-1)
assert 'Strides other than 1 not implemented!' in str(einfo.value)
def test_get_padding_for_same_non_int_kernel(self):
with pytest.raises(ValueError) as einfo:
PadUtils.get_padding_for_same((1., 1))
assert "The `kernel_size` argument must have a tuple of integers. Got: (1.0, 1) " \
"of type [<class 'float'>, <class 'int'>]" in str(einfo.value)
with pytest.raises(ValueError) as einfo:
PadUtils.get_padding_for_same((1, 1.))
assert "The `kernel_size` argument must have a tuple of integers. Got: (1, 1.0) " \
"of type [<class 'int'>, <class 'float'>]" in str(einfo.value)
with pytest.raises(ValueError) as einfo:
PadUtils.get_padding_for_same((1, '1.'))
assert "The `kernel_size` argument must have a tuple of integers. Got: (1, '1.') " \
"of type [<class 'int'>, <class 'str'>]" in str(einfo.value)
def test_get_padding_for_same_stride_3d(self):
kernel = (3, 3, 3)
pad = PadUtils.get_padding_for_same(kernel)
......@@ -50,6 +66,8 @@ class TestPadUtils:
PadUtils.get_padding_for_same((2, 4))
assert 'even kernel size not implemented. Got (2, 4)' in str(einfo.value)
##################################################################################
def test_check_padding_format_negative_pads(self):
with pytest.raises(ValueError) as einfo:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment