test float_round()

Increase coverage
This commit is contained in:
Unknown 2020-06-24 15:40:32 -04:00
parent 35ce6b4d8e
commit 67d4afff55

View File

@ -1,6 +1,8 @@
import pytest import pytest
import numpy as np
from translater import utils, timeit from translater import utils, timeit
from geomeppy.geom.polygons import Polygon3D
def test_rotate(config): def test_rotate(config):
@ -9,7 +11,8 @@ def test_rotate(config):
n = 1 # shift 1 position to the left n = 1 # shift 1 position to the left
l2 = utils.rotate(l1, n) l2 = utils.rotate(l1, n)
assert (l2 == [2, 3, 1]) assert l2 == [2, 3, 1]
@timeit @timeit
def test_lcm(config): def test_lcm(config):
@ -18,10 +21,16 @@ def test_lcm(config):
y = 50 y = 50
lcm = utils.lcm(x, y) lcm = utils.lcm(x, y)
assert (lcm == 5) assert lcm == 5
def test_float_round(config):
# Makes sure a variable is a float and round it at "n" decimals
num = 40.24
n = 1
float_num = utils.float_round(num, n)
assert float_num == 40.2