class DataSetTest(unittest.TestCase): def __init__(self,*args): unittest.TestCase.__init__(self) self.ds = DataSet() def runTest(self): try: self.test_basic() self.test_freqs() self.test_select() finally: pass def test_basic(self): self.ds = sample_dataset_factory() self.assertEqual(str(self.ds),"<DataSet of len 26: A00(100), A01(100), A02(100), A03(100), A04(100), A05(100), A06(100), A07(100), A08(100), A09(100), A10(100), A11(100), A12(100), A13(100), A14(100), A15(100), A16(100), A17(100), A18(100), A19(100), A20(100), A21(100), A22(100), A23(100), A24(100), A25(100)>") def test_freqs(self): self.ds = sample_dataset_factory() self.assertEqual(self.ds.freqs,['D',]) self.ds = sample_dataset_factory(name="X",freq='M',dataset=self.ds) self.assertEqual(set(self.ds.freqs),set(['D','M'])) def test_select(self): self.ds = sample_dataset_factory() sel = self.ds.select('A00','A25','A35') print sel
def __init__(self,*args): unittest.TestCase.__init__(self) self.ds = DataSet()