예제 #1
0
def test_on_clean_file(clean_data_file):
    expected = np.array([[201.0, 305671.0], [7892.0, 298140.0],
                         [501.0, 738293.0]])
    # Pass the clean data file path yielded by the fixture as the first argument
    actual = get_data_as_numpy_array(clean_data_file, 2)
    assert actual == pytest.approx(
        expected), "Expected: {0}, Actual: {1}".format(expected, actual)
예제 #2
0
    def test_on_clean_file(self, clean_data_file):
        expected = np.array([[2081.0, 314942.0], [1059.0, 186606.0],
                             [1148.0, 206186.0]])

        actual = get_data_as_numpy_array(clean_data_file, num_columns=2)
        message = "Expected return value: {0}, Actual return value: {1}".format(
            expected, actual)
        assert actual == pytest.approx(expected), message
예제 #3
0
 def test_on_empty_file(self, empty_file):
     expected = np.empty((0, 2))
     actual = get_data_as_numpy_array(empty_file, 2)
     msg = f"Expected: {expected}; Actual: {actual}"
     assert actual == pytest.approx(expected), msg
예제 #4
0
 def test_on_clean_file(self, clean_data):
     expected = np.array([[201.0, 305671.0], [7892.0, 298140.0],
                          [501.0, 738293.0]])
     actual = get_data_as_numpy_array(clean_data, 2)
     msg = f"Expected: {expected}; Actual: {actual}"
     assert actual == pytest.approx(expected), msg
 def test_on_empty_file(self, empty_file):
     expected = np.empty((0, 2))
     actual = get_data_as_numpy_array(empty_file, 2)
     assert actual == pytest.approx(
         expected), "Expected: {0}, Actual: {1}".format(expected, actual)
 def test_on_clean_file(self, clean_data_file):
     expected = np.array([[201.0, 305671.0], [7892.0, 298140.0],
                          [501.0, 738293.0]])
     actual = get_data_as_numpy_array(clean_data_file, 2)
     assert actual == pytest.approx(
         expected), "Expected: {0}, Actual: {1}".format(expected, actual)
예제 #7
0
 def test_on_empty_file(self, empty_file):
     expected = np.empty((0, 2))
     actual = get_data_as_numpy_array(empty_file, 2)
     message = "Expected return value: {0}, Actual return value: {1}".format(
         expected, actual)
     assert actual == pytest.approx(expected), message