Ejemplo n.º 1
0
  def test_write_frame(self):
    w = mock()
    expect( mock(content_frame, 'Writer') ).args('buffer').returns( w )
    expect( w.write_octet ).args( 3 ).returns( w )
    expect( w.write_short ).args( 42 ).returns( w )
    expect( w.write_long ).args( 5 ).returns( w )
    expect( w.write ).args( 'hello' ).returns( w )
    expect( w.write_octet ).args( 0xce )

    frame = ContentFrame(42, 'hello')
    frame.write_frame( 'buffer' )