Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2870)

Unified Diff: appengine_apps/chromium_status/tests/fill.py

Issue 778533003: Moved chromium_status to appengine/ (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine_apps/chromium_status/tests/cq.json ('k') | appengine_apps/chromium_status/tests/local_gae.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine_apps/chromium_status/tests/fill.py
diff --git a/appengine_apps/chromium_status/tests/fill.py b/appengine_apps/chromium_status/tests/fill.py
deleted file mode 100755
index c45708734e216aefa4c5a90d3a18e00fa5018130..0000000000000000000000000000000000000000
--- a/appengine_apps/chromium_status/tests/fill.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-import logging
-import optparse
-import os
-import sys
-import time
-import urllib
-
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-
-
-def post(url, data):
- return urllib.urlopen(url, urllib.urlencode(data)).read()
-
-
-def load_json():
- data = json.load(open(os.path.join(BASE_DIR, 'cq.json')))
- # Use 31 days ago as the offset.
- offset = 60*60*24*31
- for line in data:
- line['timestamp'] += time.time() - offset
- return data
-
-
-def load_packets():
- return [
- {
- 'password': 'foobar',
- 'p': json.dumps(data),
- } for data in load_json()
- ]
-
-
-def main():
- parser = optparse.OptionParser()
- parser.add_option('-v', '--verbose', action='count', default=0)
- options, args = parser.parse_args()
-
- logging.basicConfig(level=
- [logging.WARNING, logging.INFO, logging.DEBUG][
- min(2, options.verbose)])
- if len(args) != 1:
- parser.error('Url of server')
-
- url = args[0].rstrip('/')
- if '://' not in url:
- url = 'http://' + url
- total = 0
- for packet in load_packets():
- output = post(url + '/cq/receiver', packet)
- try:
- total += int(output)
- except ValueError:
- print output
- if total != 7:
- print >> sys.stderr, 'Unexpected length: %d' % total
- return 1
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « appengine_apps/chromium_status/tests/cq.json ('k') | appengine_apps/chromium_status/tests/local_gae.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698