Ejemplo n.º 1
0
 def test_creation_of_object(self):
     with self.assertRaises(ValueError):
         GPL(name='name',
             table=['a'],
             metadata=self.metadata,
             columns=self.columns1)
     with self.assertRaises(TypeError):
         GPL(name='name',
             table=self.table1,
             metadata=[],
             columns=self.columns1)
     with self.assertRaises(ValueError):
         GPL(name='name',
             table=self.table1,
             metadata=self.metadata,
             columns=[])
     with self.assertRaises(DataIncompatibilityException):
         GPL(name='name',
             table=self.table1,
             metadata=self.metadata,
             columns=self.columns2)
     GPL(name='name',
         table=self.table1,
         metadata=self.metadata,
         columns=self.columns1)
Ejemplo n.º 2
0
 def setUp(self):
     self.header1 = ['a', 'b', 'c']
     self.header2 = ['a', 'b', 'd']
     self.columns_desc = [['first column'], ['second column'],
                          ['third column']]
     self.data = [[1, 2, 3], [4, 5, 6]]
     self.table1 = DataFrame(self.data, columns=self.header1)
     self.table2 = DataFrame(self.data, columns=self.header2)
     self.columns1 = DataFrame(self.columns_desc,
                               self.header1,
                               columns=['description'])
     self.columns2 = DataFrame(self.columns_desc,
                               self.header2,
                               columns=['description'])
     self.metadata = {'name': 'PLATFORM'}
     self.gpl = GPL(name='name',
                    table=self.table1,
                    metadata=self.metadata,
                    columns=self.columns1)
     self.gsm1 = GSM(name='name',
                     table=self.table1,
                     metadata=self.metadata,
                     columns=self.columns1)
     self.gsm2 = GSM(name='name',
                     table=self.table2,
                     metadata=self.metadata,
                     columns=self.columns2)
     self.gsms = {'a': self.gsm1, 'b': self.gsm2}
     self.gpls = {'a': self.gpl}
Ejemplo n.º 3
0
 def test_simple_data(self):
     gpl = GPL(name='name',
               table=self.table1,
               metadata=self.metadata,
               columns=self.columns1)
     self.assertEqual(gpl.table.ix[0, 'a'], 1)
     self.assertEqual(gpl.table.ix[1, 'b'], 5)
Ejemplo n.º 4
0
 def setUp(self):
     self.header1 = ["a", "b", "c"]
     self.header2 = ["a", "b", "d"]
     self.columns_desc = [["first column"], ["second column"],
                          ["third column"]]
     self.data = [[1, 2, 3], [4, 5, 6]]
     self.table1 = DataFrame(self.data, columns=self.header1)
     self.table2 = DataFrame(self.data, columns=self.header2)
     self.columns1 = DataFrame(self.columns_desc,
                               self.header1,
                               columns=["description"])
     self.columns2 = DataFrame(self.columns_desc,
                               self.header2,
                               columns=["description"])
     self.metadata = {"name": "PLATFORM"}
     self.gpl = GPL(
         name="name",
         table=self.table1,
         metadata=self.metadata,
         columns=self.columns1,
     )
     self.gsm1 = GSM(
         name="name",
         table=self.table1,
         metadata=self.metadata,
         columns=self.columns1,
     )
     self.gsm2 = GSM(
         name="name",
         table=self.table2,
         metadata=self.metadata,
         columns=self.columns2,
     )
     self.gsms = {"a": self.gsm1, "b": self.gsm2}
     self.gpls = {"a": self.gpl}
Ejemplo n.º 5
0
 def test_simple_data(self):
     gpl = GPL(
         name="name",
         table=self.table1,
         metadata=self.metadata,
         columns=self.columns1,
     )
     self.assertEqual(gpl.table.loc[0, "a"], 1)
     self.assertEqual(gpl.table.loc[1, "b"], 5)