# Path: repokid/dispatcher/types.py
# class Message(BaseModel):
#     account: str
#     command: str
#     role_name: str
#     respond_channel: str
#     errors: List[str] = Field(default=[])
#     respond_user: str = Field(default="")
#     requestor: str = Field(default="")
#     reason: str = Field(default="")
#     selection: str = Field(default="")


import copy
import pytest
import repokid.dispatcher as dispatcher
from mock import call
from mock import patch
from pydantic.error_wrappers import ValidationError
from repokid.dispatcher.types import Message
    respond_channel="respond_channel",
    respond_user="some_user",
    requestor="a_requestor",
    reason="some_reason",
    selection="some_selection",
)


class TestDispatcherCLI(object):
    def test_message_creation(self):
        test_message = MESSAGE
        assert test_message.command == "command"
        assert test_message.account == "account"
        assert test_message.role_name == "role"
        assert test_message.respond_channel == "respond_channel"
        assert test_message.respond_user == "some_user"
        assert test_message.requestor == "a_requestor"
        assert test_message.reason == "some_reason"
        assert test_message.selection == "some_selection"

    def test_schema(self):

        # happy path
        test_message = {
            "command": "list_repoable_services",
            "account": "123",
            "role_name": "abc",
            "respond_channel": "channel",
            "respond_user": "user",
        }

# Path: repokid/dispatcher/types.py
# class Message(BaseModel):
#     account: str
#     command: str
#     role_name: str
#     respond_channel: str
#     errors: List[str] = Field(default=[])
#     respond_user: str = Field(default="")
#     requestor: str = Field(default="")
#     reason: str = Field(default="")
#     selection: str = Field(default="")


# Path: tests/test_dispatcher_cli.py
import copy
import pytest
import repokid.dispatcher as dispatcher
from mock import call
from mock import patch
from pydantic.error_wrappers import ValidationError
from repokid.dispatcher.types import Message

    respond_channel="respond_channel",
    respond_user="some_user",
    requestor="a_requestor",
    reason="some_reason",
    selection="some_selection",
)


class TestDispatcherCLI(object):
    def test_message_creation(self):
        test_message = MESSAGE
        assert test_message.command == "command"
        assert test_message.account == "account"
        assert test_message.role_name == "role"
        assert test_message.respond_channel == "respond_channel"
        assert test_message.respond_user == "some_user"
        assert test_message.requestor == "a_requestor"
        assert test_message.reason == "some_reason"
        assert test_message.selection == "some_selection"

    def test_schema(self):

        # happy path
        test_message = {
            "command": "list_repoable_services",
            "account": "123",
            "role_name": "abc",
            "respond_channel": "channel",
            "respond_user": "user",
        }

        result = Message.parse_obj(test_message)