def test_get_val(self, rvs_mock):
        """Checks the random value."""

        # Setup
        transformer = CatTransformer()
        transformer.probability_map = {
            'A': ((0.6, 1.0), 0.8, 0.0666),
            'B': ((0, 0.6), 0.3, 0.0999)
        }
        rvs_mock.return_value = 1

        # Run
        result = transformer.get_val('B')

        # Check
        assert result == 1
    def test_reverse_transform(self):
        """reverse_transform change back the data into original format."""

        # Setup
        col_meta = {"name": "breakfast", "type": "categorical"}
        transformer = CatTransformer(col_meta=col_meta, missing=False)
        transformer.probability_map = {
            'A': ((0.6, 1.0), 0.8, 0.0666),
            'B': ((0, 0.6), 0.3, 0.0999)
        }
        transformer.col_name = 'breakfast'

        col = pd.DataFrame({'breakfast': [0.1, 0.4, 0.8, 0.3, 0.7]})
        expected_result = pd.DataFrame(
            {'breakfast': ['B', 'B', 'A', 'B', 'A']})

        # Run
        result = transformer.reverse_transform(col)

        # Check
        assert result.equals(expected_result)