Skip to content

Commit

Permalink
coverage: return to 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoarbitrio committed Jul 27, 2020
1 parent 5ad862b commit 0d50fd9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cr/cube/cubepart.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def cube_is_mr_by_itself(self):
return False

@lazyproperty
def cube_row_dimension(self):
def cube_row_dimension_type(self):
"""Member of `cr.cube.enum.DIMENSION_TYPE` for cube row dimension"""
return self._cube.dimensions[0].dimension_type

Expand Down
21 changes: 21 additions & 0 deletions tests/unit/test_cubepart.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from cr.cube.cube import Cube
from cr.cube.cubepart import CubePartition, _Slice, _Strand, _Nub
from cr.cube.dimension import Dimension
from cr.cube.enum import DIMENSION_TYPE as DT
from cr.cube.matrix import TransformedMatrix, _VectorAfterHiding
from cr.cube.stripe import _BaseStripeRow, TransformedStripe

Expand Down Expand Up @@ -67,6 +68,26 @@ def it_knows_if_cube_is_mr_by_itself(self):
# --- default of False is overridden by subclasses when appropriate ---
assert CubePartition(None).cube_is_mr_by_itself is False

@pytest.mark.parametrize(
"dims, expected_value",
(
((DT.CAT, DT.MR, DT.MR_CAT), DT.CAT),
((DT.MR, DT.MR_CAT), DT.MR),
((DT.MR_CAT,), DT.MR_CAT),
),
)
def it_knows_cube_row_dimension_type(self, request, cube_, dims, expected_value):
all_dimensions_ = tuple(
instance_mock(request, Dimension, name="dim-%d" % idx, dimension_type=dt)
for idx, dt in enumerate(dims)
)
cube_.dimensions = all_dimensions_
cube_partition = CubePartition(cube_)

cube_row_dimension_type = cube_partition.cube_row_dimension_type

assert cube_row_dimension_type == expected_value

def it_knows_the_primary_alpha_value_to_help(self, _alpha_values_prop_):
"""alpha is the primary confidence-interval threshold specified by the user."""
_alpha_values_prop_.return_value = (0.042, 0.084)
Expand Down

0 comments on commit 0d50fd9

Please sign in to comment.