Example #1
0
  def test_clear_synchronous_cb_when_pending_cb_doesnt_match_but_isnt_in_list(self):
    c = Channel(None,None)
    c._pending_events = ['foo']

    expect( c._flush_pending_events )

    c.clear_synchronous_cb( 'bar' )
    assertEquals( ['foo'], c._pending_events )
Example #2
0
  def test_clear_synchronous_cb_when_pending_cb_matches(self):
    c = Channel(None,None)
    c._pending_events = ['foo']

    expect( c._flush_pending_events )

    c.clear_synchronous_cb( 'foo' )
    assertEquals( [], c._pending_events )
Example #3
0
    def test_clear_synchronous_cb_when_pending_cb_matches(self):
        c = Channel(None, None)
        c._pending_events = ['foo']

        expect(c._flush_pending_events)

        c.clear_synchronous_cb('foo')
        assertEquals([], c._pending_events)
Example #4
0
    def test_clear_synchronous_cb_when_pending_cb_doesnt_match_but_isnt_in_list(
            self):
        c = Channel(None, None)
        c._pending_events = ['foo']

        expect(c._flush_pending_events)

        c.clear_synchronous_cb('bar')
        assertEquals(['foo'], c._pending_events)
Example #5
0
    def test_clear_synchronous_cb_when_pending_cb_doesnt_match_but_isnt_in_list(self):
        c = Channel(None, None, {})
        c._pending_events = deque(['foo'])

        expect(c._flush_pending_events)

        assert_equals('bar', c.clear_synchronous_cb('bar'))
        assert_equals(deque(['foo']), c._pending_events)
Example #6
0
    def test_clear_synchronous_cb_when_pending_cb_matches(self):
        c = Channel(None, None, {})
        c._pending_events = deque(['foo'])

        expect(c._flush_pending_events)

        assert_equals('foo', c.clear_synchronous_cb('foo'))
        assert_equals(deque([]), c._pending_events)
Example #7
0
    def test_clear_synchronous_cb_when_pending_cb_matches(self):
        c = Channel(None, None, {})
        c._pending_events = deque(['foo'])

        expect(c._flush_pending_events)

        assert_equals('foo', c.clear_synchronous_cb('foo'))
        assertEquals(deque([]), c._pending_events)
Example #8
0
  def test_clear_synchronous_cb_when_pending_cb_doesnt_match_but_isnt_in_list(self):
    c = Channel(None,None,{})
    c._pending_events = deque(['foo'])

    expect( c._flush_pending_events )

    assert_equals( 'bar', c.clear_synchronous_cb('bar') )
    assertEquals( deque(['foo']), c._pending_events )
Example #9
0
    def test_clear_synchronous_cb_when_no_pending(self):
        c = Channel(None, None, {})
        stub(c._flush_pending_events)

        assert_equals(deque([]), c._pending_events)
        assert_equals('foo', c.clear_synchronous_cb('foo'))
Example #10
0
    def test_clear_synchronous_cb_when_no_pending(self):
        c = Channel(None, None, {})
        stub(c._flush_pending_events)

        assertEquals(deque([]), c._pending_events)
        assert_equals('foo', c.clear_synchronous_cb('foo'))
Example #11
0
  def test_clear_synchronous_cb_when_no_pending(self):
    c = Channel(None,None)
    stub( c._flush_pending_events )

    assertEquals( [], c._pending_events )
    c.clear_synchronous_cb( 'foo' )