Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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