Exemple #1
0
    def test_has_payload__for_callable(self):
        vertex = Vertex('vertex_44', DepDag())
        self.assertFalse(vertex.has_payload())

        call_log = list()

        def has_payload_callback():
            call_log.append('CALLED')
            return True

        vertex.payload = has_payload_callback
        self.assertTrue(vertex.has_payload())
        self.assertEqual(['CALLED'], call_log)
Exemple #2
0
 def test_has_payload__for_object(self):
     vertex = Vertex('vertex_33', DepDag())
     self.assertFalse(vertex.has_payload())
     vertex.payload = "any payload would do"
     self.assertTrue(vertex.has_payload())
Exemple #3
0
 def test_creation__test_name(self):
     vertex = Vertex('vertex_11', DepDag())
     self.assertEqual('vertex_11', vertex.name)
     self.assertFalse(vertex.has_payload())