Пример #1
0
    def test_is_session_should_be_false(self):
        # Arrange
        envelope = Command('get')

        # Act
        result = Envelope.is_session(envelope)

        # Assert
        assert result is False
Пример #2
0
    def test_is_command_should_be_false(self):
        # Arrange
        envelope = Session('new')

        # Act
        result = Envelope.is_command(envelope)

        # Assert
        assert result is False
Пример #3
0
    def test_is_session_should_be_true(self):
        # Arrange
        envelope = Session('new')

        # Act
        result = Envelope.is_session(envelope)

        # Assert
        assert result is True
Пример #4
0
    def test_is_command_should_be_true(self):
        # Arrange
        envelope = Command('get')

        # Act
        result = Envelope.is_command(envelope)

        # Assert
        assert result is True
Пример #5
0
    def test_is_message_should_be_true(self):
        # Arrange
        envelope = Message('application/json', {'some': 'content'})

        # Act
        result = Envelope.is_message(envelope)

        # Assert
        assert result is True
Пример #6
0
    def test_is_notification_should_be_false(self):
        # Arrange
        envelope = Session('new')

        # Act
        result = Envelope.is_notification(envelope)

        # Assert
        assert result is False
Пример #7
0
    def test_is_notification_should_be_true(self):
        # Arrange
        envelope = Notification('consumed')

        # Act
        result = Envelope.is_notification(envelope)

        # Assert
        assert result is True
Пример #8
0
    def test_is_message_should_be_false(self):
        # Arrange
        envelope = Notification('consumed')

        # Act
        result = Envelope.is_message(envelope)

        # Assert
        assert result is False