Exemplo n.º 1
0
 def test_feed_with_unknown_param_fails(self) -> None:
     """Test that calling feed with not supported param fails."""
     feeder = Feeder(data={"param": "foo"})
     with self.assertRaisesRegex(
         ClientErrorException,
         "Could not found method for foo parameter.",
     ):
         feeder.feed()
Exemplo n.º 2
0
    def test_feed_for_framework_works(self, mocked_get_frameworks: MagicMock) -> None:
        """Test that calling feed with not supported param fails."""
        frameworks = [
            {"name": "framework1"},
            {"name": "framework2"},
            {"name": "framework3"},
        ]
        mocked_get_frameworks.return_value = frameworks
        expected = {"framework": frameworks}

        feeder = Feeder(data={"param": "framework"})
        actual = feeder.feed()

        self.assertEqual(expected, actual)
Exemplo n.º 3
0
 def test_feed_without_param_failes(self) -> None:
     """Test that calling feed when param is not set fails."""
     feeder = Feeder(data={})
     with self.assertRaisesRegex(ClientErrorException, "Parameter not defined."):
         feeder.feed()