class TestDefaultDiagnostics(unittest.TestCase): """Checks some basic operations on the DefaultDiagnostics class Eventually this will report errors. For now, there isn't much to test. """ def setUp(self): self.diag = DefaultDiagnostics() self.i = self.diag.wrap(xrange(1, 6)) def test_wrap(self): for ((a, b), c) in izip(self.i, xrange(1, 6)): self.assertEquals(a, c) self.assertEquals(b, c) def test_wrap_len(self): self.assertEquals(len(list(self.i)), 5) def test_tokens(self): self.assertEquals(self.diag.tokens, []) for (a, b) in self.i: self.assertEquals(self.diag.tokens, zip(range(1, a + 1), range(1, a + 1))) def test_cut(self): self.i.next() self.i.next() c, p = self.i.next() self.diag.cut(p) self.assertEquals(self.diag.tokens, [(3, 3)])
class TestDefaultDiagnostics(unittest.TestCase): """Checks some basic operations on the DefaultDiagnostics class Eventually this will report errors. For now, there isn't much to test. """ def setUp(self): self.diag = DefaultDiagnostics() self.i = self.diag.wrap(xrange(1, 6)) def test_wrap(self): for ((a, b), c) in izip(self.i, xrange(1, 6)): self.assertEquals(a, c) self.assertEquals(b, c) def test_wrap_len(self): self.assertEquals(len(list(self.i)), 5) def test_tokens(self): self.assertEquals(self.diag.tokens, []) for (a, b) in self.i: self.assertEquals(self.diag.tokens, zip(range(1, a+1),range(1, a+1))) def test_cut(self): self.i.next() self.i.next() c, p = self.i.next() self.diag.cut(p) self.assertEquals(self.diag.tokens, [(3,3)])
def setUp(self): self.diag = DefaultDiagnostics() self.i = self.diag.wrap(xrange(1, 6))