class TestWalker(TestCase): def setUp(self): super(TestWalker, self).setUp() self.walker = DummyWalker() self.data = [0, 1] def check(self): truth = set([op.join('', 'foo', str(i)) for i in self.data]) self.assertEqual(self.walker.paths, truth) def test_coroutine(self): inject(self.data, self.walker.write(dsetname='foo')) self.check() def test_generator(self): self.walker.write(data=self.data, dsetname='foo') self.check()
def setUp(self): super(TestExperimentBase, self).setUp() self.acquired = 0 self.root = '' self.walker = DummyWalker(root=self.root) self.name_fmt = 'scan_{:>04}' self.visited = 0 self.foo = Acquisition("foo", self.produce, consumers=[self.consume], acquire=self.acquire) self.bar = Acquisition("bar", self.produce, acquire=self.acquire) self.acquisitions = [self.foo, self.bar] self.num_produce = 2 self.item = None
def setUp(self): super(TestWalker, self).setUp() self.walker = DummyWalker() self.data = [0, 1]