# Path: vii/Signals.py
# def slot(signal, receiver):
#     register[signal].append(receiver)


from nose.tools import *
from vii.Buffer import *
from vii.Signals import slot

class Receiver:

    def __init__(self):
        slot("updatedBuffer", self)
        slot("filledBuffer", self)
        slot("deletedFromBuffer", self)
        slot("insertedIntoBuffer", self)
        self.seen = {}

    def receive(self, signal, sender, **args):
        self.seen[signal] = args

class Buffer_Test:

    def fillAndClear(self, text):
        self.buffer.fill(text)
        self.signals.clear()

    def setup(self):
        self.receiver = Receiver()
        self.signals = self.receiver.seen
        self.buffer = Buffer()

    def test_init(self):
        assert self.buffer.__class__ == Buffer
        assert Buffer.updatedSignal == "updatedBuffer"

# Path: vii/Signals.py
# def slot(signal, receiver):
#     register[signal].append(receiver)


# Path: tests/Buffer_Test.py
from nose.tools import *
from vii.Buffer import *
from vii.Signals import slot


class Receiver:

    def __init__(self):
        slot("updatedBuffer", self)
        slot("filledBuffer", self)
        slot("deletedFromBuffer", self)
        slot("insertedIntoBuffer", self)
        self.seen = {}

    def receive(self, signal, sender, **args):
        self.seen[signal] = args

class Buffer_Test:

    def fillAndClear(self, text):
        self.buffer.fill(text)
        self.signals.clear()

    def setup(self):
        self.receiver = Receiver()
        self.signals = self.receiver.seen
        self.buffer = Buffer()

    def test_init(self):
        assert self.buffer.__class__ == Buffer
        assert Buffer.updatedSignal == "updatedBuffer"

        assert Buffer.filledSignal == "filledBuffer"