コード例 #1
0
 def test_id_readonly(self):
     rch = interpreters.RecvChannel(1)
     with self.assertRaises(AttributeError):
         rch.id = 2
コード例 #2
0
    def test_custom_id(self):
        rch = interpreters.RecvChannel(1)
        self.assertEqual(rch.id, 1)

        with self.assertRaises(TypeError):
            interpreters.RecvChannel('1')