Ejemplo n.º 1
0
    def test_update_args(self):
        """Test update_args."""
        obj = ServerlessOptions(
            args=['--config', 'something', '--unknown-arg', 'value'],
            extend_serverless_yml={},
            promotezip={})
        assert obj.args == ['--config', 'something', '--unknown-arg', 'value']

        obj.update_args('config', 'something-else')
        assert obj.args == [
            '--config', 'something-else', '--unknown-arg', 'value'
        ]

        with pytest.raises(KeyError):
            obj.update_args('invalid-key', 'anything')
Ejemplo n.º 2
0
    def test_update_args(self):
        """Test update_args."""
        obj = ServerlessOptions(
            args=["--config", "something", "--unknown-arg", "value"],
            extend_serverless_yml={},
            promotezip={},
        )
        assert obj.args == ["--config", "something", "--unknown-arg", "value"]

        obj.update_args("config", "something-else")
        assert obj.args == [
            "--config", "something-else", "--unknown-arg", "value"
        ]

        with pytest.raises(KeyError):
            obj.update_args("invalid-key", "anything")
Ejemplo n.º 3
0
 def test_args(self, args, expected):
     """Test args."""
     obj = ServerlessOptions(args=args,
                             extend_serverless_yml={},
                             promotezip={})
     assert obj.args == expected