From c98e08fe36fb97f63ac181c948c9f50aa574cef8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 19 Apr 2015 11:40:49 +0800 Subject: [PATCH] fix transforms unittest --- artiq/coredevice/comm_dummy.py | 5 ++--- artiq/test/transforms.py | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/coredevice/comm_dummy.py b/artiq/coredevice/comm_dummy.py index b9eb648fe..84aafb666 100644 --- a/artiq/coredevice/comm_dummy.py +++ b/artiq/coredevice/comm_dummy.py @@ -6,8 +6,7 @@ from artiq.coredevice.runtime import LinkInterface class _RuntimeEnvironment(LinkInterface): - def __init__(self, ref_period): - self.internal_ref_period = ref_period + def __init__(self): self.warmup_time = 1*ms def emit_object(self): @@ -16,7 +15,7 @@ class _RuntimeEnvironment(LinkInterface): class Comm(AutoDB): def get_runtime_env(self): - return _RuntimeEnvironment(1*ns) + return _RuntimeEnvironment() def switch_clock(self, external): pass diff --git a/artiq/test/transforms.py b/artiq/test/transforms.py index c7893f236..b9ee5e30d 100644 --- a/artiq/test/transforms.py +++ b/artiq/test/transforms.py @@ -1,6 +1,7 @@ import unittest import ast +from artiq import ns from artiq.coredevice import comm_dummy, core from artiq.transforms.unparse import unparse @@ -39,7 +40,7 @@ def run(): class OptimizeCase(unittest.TestCase): def test_optimize(self): - coredev = core.Core(comm=comm_dummy.Comm()) + coredev = core.Core(comm=comm_dummy.Comm(), ref_period=1*ns) func_def = ast.parse(optimize_in).body[0] coredev.transform_stack(func_def, dict(), dict()) self.assertEqual(unparse(func_def), optimize_out)