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)
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())
def test_creation__test_name(self): vertex = Vertex('vertex_11', DepDag()) self.assertEqual('vertex_11', vertex.name) self.assertFalse(vertex.has_payload())