Example #1
0
    def test_min_element_correct(self):
        array1 = Array((3, ), -1.0, 2.4, 1.0)
        array2 = Array((3, ), -1, 2, 1)
        array3 = Array((2, ), True, False)
        result1 = array1.min_element()
        result2 = array2.min_element()
        result3 = array3.min_element()

        assert result1 == -1.0
        assert result2 == -1
        assert result3 == False
Example #2
0
def test_min_element(arg, expected):
    """
    Verify that smallest numeric of array is found
    """
    my_arr = Array(arg[0], *arg[1])
    assert my_arr.min_element() == expected
Example #3
0
    def test_min_element_2D_correct(self):
        array1 = Array((2, 3), 1, 2, 3, 4, 0, 6)
        result = array1.min_element()

        assert result == 0
Example #4
0
    def test_min_element_incorrect(self):
        array1 = Array((4, ), -1.0, 2.4, 1.0, -1.0)
        result = array1.min_element()

        assert result != 1.0