Exemplo n.º 1
0
  def test_transmit(self):
    s = Storage()
    s.storage = MagicMock()
    s.storage.record = MagicMock()

    s.record()

    self.assertEqual(s.storage.record.call_count, 1)
Exemplo n.º 2
0
    def test_transmit(self):
        s = Storage()
        s.storage = MagicMock()
        s.storage.record = MagicMock()

        s.record()

        self.assertEqual(s.storage.record.call_count, 1)
Exemplo n.º 3
0
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()