示例#1
0
 def __init__(self):
     Decorable.__init__(self)
     self.input_area = {}
     self.processing_area = {}
     self.output_area = {}
     self.log_area = {}
     self.tag = None
     self.location = None
示例#2
0
 def __init__(self):
     Decorable.__init__(self)
     self.input_area = {}
     self.processing_area = {}
     self.output_area = {}
     self.log_area = {}
     self.tag = None
     self.location = None
示例#3
0
 def __init__(self, source, destination):
     Decorable.__init__(self)
     try:
         source |should| be_instance_of(Node)
     except:
         raise ContractError('Source: Node instance expected, instead %s passed' % type(source))
     self.source = source
     try:
         destination |should| be_instance_of(Node)
     except:
         raise ContractError('Destination: Node instance expected, instead %s passed' % type(destination))
     self.destination = destination
示例#4
0
 def __init__(self, source, destination):
     Decorable.__init__(self)
     try:
         source | should | be_instance_of(Node)
     except:
         raise ContractError(
             'Source: Node instance expected, instead %s passed' %
             type(source))
     self.source = source
     try:
         destination | should | be_instance_of(Node)
     except:
         raise ContractError(
             'Destination: Node instance expected, instead %s passed' %
             type(destination))
     self.destination = destination
示例#5
0
class DecorableSpec(unittest.TestCase):
    def setUp(self):
        self.a_node = Decorable()
        self.a_decorator = Decorator()

    def it_gets_decorated(self):
        self.a_node.decorate(self.a_decorator)
        self.a_node |should| have(1).decorators
        self.a_node.decoration_history |should| have(1).element

    def it_gest_undecorated(self):
        self.a_node.decorate(self.a_decorator)
        self.a_node.undecorate(self.a_decorator) |should| be(True)
        self.a_node.undecorate('Something else') |should| be(False)
class DecorableSpec(unittest.TestCase):
    def setUp(self):
        self.a_node = Decorable()
        self.a_decorator = Decorator()

    def it_gets_decorated(self):
        self.a_node.decorate(self.a_decorator)
        self.a_node | should | have(1).decorators
        self.a_node.decoration_history | should | have(1).element

    def it_gest_undecorated(self):
        self.a_node.decorate(self.a_decorator)
        self.a_node.undecorate(self.a_decorator) | should | be(True)
        self.a_node.undecorate('Something else') | should | be(False)
示例#7
0
 def setUp(self):
     self.a_node = Decorable()
     self.a_decorator = Decorator()
 def setUp(self):
     self.a_node = Decorable()
     self.a_decorator = Decorator()