Exemplo n.º 1
0
    def test_get_precisions_for_missing_framework(
        self,
        mocked_load_precisions_config: MagicMock,
    ) -> None:
        """Test get_precisions function."""
        mocked_load_precisions_config.return_value = {
            "framework_foo": [
                {
                    "foo": {}
                },
                {
                    "bar": {}
                },
                {
                    "baz": {}
                },
            ],
            "framework_bar": [
                {
                    "foo": {}
                },
            ],
        }

        feeder = Feeder(data={})

        with self.assertRaisesRegex(ClientErrorException,
                                    "Framework not set."):
            feeder.get_precisions()
Exemplo n.º 2
0
    def test_get_precisions_for_unknown_framework(
        self,
        mocked_load_precisions_config: MagicMock,
    ) -> None:
        """Test get_precisions function."""
        mocked_load_precisions_config.return_value = {
            "framework_foo": [
                {"foo": {}},
                {"bar": {}},
                {"baz": {}},
            ],
            "framework_bar": [
                {"foo": {}},
            ],
        }

        feeder = Feeder(
            data={
                "config": {
                    "framework": "framework_baz",
                },
            },
        )
        actual = feeder.get_precisions()

        self.assertEqual([], actual)