'Test GlancesAttribute classe'

def test_097_attribute(self):

    print 'INFO:    [TEST_097]    Test    attribute'
    from glances.attribute import GlancesAttribute
    a = GlancesAttribute('a', description='ad', history_max_size=3)
    self.assertEqual(a.name, 'a')
    self.assertEqual(a.description, 'ad')
    a.description = 'adn'
    self.assertEqual(a.description, 'adn')
    a.value = 1
    a.value = 2
    self.assertEqual(len(a.history), 2)
    a.value = 3
    self.assertEqual(len(a.history), 3)
    a.value = 4
    self.assertEqual(len(a.history), 3)
    self.assertEqual(a.history_size(), 3)
    self.assertEqual(a.history_len(), 3)
    self.assertEqual(a.history_value()[1], 4)
    self.assertEqual(a.history_mean(nb=3), 4.5)
