def test_get_stats(self): """Test reading and writing stat objects""" s = statistics.StatsObj() self.assertIsNone(s.get_stat('SourceFiles')) self.set_obj(s) self.assertEqual(s.get_stat('SourceFiles'), 1) s1 = statistics.StatFileObj() self.assertEqual(s1.get_stat('SourceFiles'), 0)
def test_get_stats(self): """Test reading and writing stat objects""" s = statistics.StatsObj() assert s.get_stat('SourceFiles') is None self.set_obj(s) assert s.get_stat('SourceFiles') == 1 s1 = statistics.StatFileObj() assert s1.get_stat('SourceFiles') == 0
def __init__(self, basis_root_rp, CCPP): """Set basis_root_rp, the base of the tree to be incremented""" self.basis_root_rp = basis_root_rp assert basis_root_rp.conn is Globals.local_connection, ( "Basis root path connection {conn} isn't " "local connection {lconn}.".format( conn=basis_root_rp.conn, lconn=Globals.local_connection)) self.statfileobj = (statistics.get_active_statfileobj() or statistics.StatFileObj()) self.dir_replacement, self.dir_update = None, None self.CCPP = CCPP self.error_handler = robust.get_error_handler("UpdateError")