def test_transmit(self): s = Storage() s.storage = MagicMock() s.storage.record = MagicMock() s.record() self.assertEqual(s.storage.record.call_count, 1)
def main(): # persist data generated by monitor parser = argparse.ArgumentParser() parser.add_argument('-l', '--log', dest='loglevel', help="set the level of messages to display") parser.add_argument('-c', '--config', dest='config', help="load configuration from this file") args = parser.parse_args() if args.config: Config.load(args.config) setup_logger(logger, args.loglevel, Config, "record.log") # start recording forever storage = Storage() storage.record()