Exemplo n.º 1
0
 def test_is_valid_key2(self):
     """test that a duplicate key is invalid"""
     model = PivotModel()
     model.set_new_data(self.data, self.index_names, self.index_types)
     self.assertFalse(model.is_valid_key(('a', 'aa', 1),
                                         model._row_data_header_set,
                                         ('test1', 'test2', 'test3')))
Exemplo n.º 2
0
 def test_is_valid_key3(self):
     """test that akey with invalid type is invalid"""
     model = PivotModel()
     model.set_new_data(self.data, self.index_names, self.index_types)
     self.assertFalse(model.is_valid_key(('a', 'aa', 'invalid_type'),
                                         model._row_data_header_set,
                                         ('test1', 'test2', 'test3')))
Exemplo n.º 3
0
 def test_is_valid_key1(self):
     """test that a correct key is valid"""
     model = PivotModel()
     model.set_new_data(self.data, self.index_names, self.index_types)
     model._add_index_value('valid1','test1')
     model._add_index_value('valid2','test2')
     model._add_index_value(4,'test3')
     self.assertTrue(model.is_valid_key(('valid1', 'valid2', 4),
                                         model._row_data_header_set,
                                         ('test1', 'test2', 'test3')))