from hover.utils.metrics import classification_accuracy
import numpy as np

def test_classification_accuracy():
    true = np.array([1, 2, 3, 4, 5, 6, 7, 7])
    pred = np.array([1, 2, 3, 4, 5, 6, 7, 8])
    accl = classification_accuracy(true, pred)
    accr = classification_accuracy(pred, true)
    assert np.allclose(accl, 7/8)
    assert np.allclose(accr, 7/8)

[(5, 'numpy.array', 'np.array', True, 'import numpy as np\n'), (6, 'numpy.array', 'np.array', True, 'import numpy as np\n'), (7, 'hover.utils.metrics.classification_accuracy', 'classification_accuracy', False, 'from hover.utils.metrics import classification_accuracy\n'), (8, 'hover.utils.metrics.classification_accuracy', 'classification_accuracy', False, 'from hover.utils.metrics import classification_accuracy\n'), (9, 'numpy.allclose', 'np.allclose', True, 'import numpy as np\n'), (10, 'numpy.allclose', 'np.allclose', True, 'import numpy as np\n')]