'If L{LengthEnforcingConsumer.write} is called after
L{LengthEnforcingConsumer._noMoreWritesExpected}, it calls the
producer\'s C{stopProducing} method and raises L{ExcessWrite}.'

def test_writeAfterNoMoreExpected(self):

    self.enforcer.write(('x' * 10))
    self.enforcer._noMoreWritesExpected()
    self.assertFalse(self.producer.stopped)
    self.assertRaises(ExcessWrite, self.enforcer.write, 'x')
    self.assertTrue(self.producer.stopped)
