| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import datetime | 5 import datetime |
| 6 import json | 6 import json |
| 7 import mock | 7 import mock |
| 8 import urllib2 | 8 import urllib2 |
| 9 | 9 |
| 10 from google.appengine.datastore import datastore_stub_util | 10 from google.appengine.datastore import datastore_stub_util |
| 11 from google.appengine.ext import ndb | 11 from google.appengine.ext import ndb |
| 12 | 12 |
| 13 import gae_ts_mon | 13 import gae_ts_mon |
| 14 from handlers.flake_issues import ProcessIssue, CreateFlakyRun | 14 from handlers.flake_issues import ProcessIssue, CreateFlakyRun |
| 15 import main | 15 import main |
| 16 from model.flake import Flake, FlakyRun, FlakeOccurrence | 16 from model.flake import Flake, FlakyRun, FlakeOccurrence |
| 17 from model.build_run import PatchsetBuilderRuns, BuildRun | 17 from model.build_run import PatchsetBuilderRuns, BuildRun |
| 18 from testing_utils import testing | 18 from testing_utils import testing |
| 19 from time_functions.testing import mock_datetime_utc | 19 from infra_libs.time_functions.testing import mock_datetime_utc |
| 20 | 20 |
| 21 | 21 |
| 22 TEST_TEST_RESULTS_REPLY = json.dumps({ | 22 TEST_TEST_RESULTS_REPLY = json.dumps({ |
| 23 'tests': { | 23 'tests': { |
| 24 'test1': { | 24 'test1': { |
| 25 'expected': 'PASS', | 25 'expected': 'PASS', |
| 26 'actual': 'FAIL FAIL PASS', | 26 'actual': 'FAIL FAIL PASS', |
| 27 }, | 27 }, |
| 28 'test2': { | 28 'test2': { |
| 29 'a': { | 29 'a': { |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 key = Flake(name='foobar', issue_id=issue.id).put() | 1017 key = Flake(name='foobar', issue_id=issue.id).put() |
| 1018 self.test_app.get( | 1018 self.test_app.get( |
| 1019 '/override_issue_id?key=%s&issue_id=%d' % (key.urlsafe(), issue.id)) | 1019 '/override_issue_id?key=%s&issue_id=%d' % (key.urlsafe(), issue.id)) |
| 1020 self.assertEqual(key.get().issue_id, issue.id) | 1020 self.assertEqual(key.get().issue_id, issue.id) |
| 1021 | 1021 |
| 1022 def test_overrides_issue_id_with_0(self): | 1022 def test_overrides_issue_id_with_0(self): |
| 1023 key = Flake(name='foobar', issue_id=100000).put() | 1023 key = Flake(name='foobar', issue_id=100000).put() |
| 1024 self.test_app.get( | 1024 self.test_app.get( |
| 1025 '/override_issue_id?key=%s&issue_id=0' % key.urlsafe()) | 1025 '/override_issue_id?key=%s&issue_id=0' % key.urlsafe()) |
| 1026 self.assertEqual(key.get().issue_id, 0) | 1026 self.assertEqual(key.get().issue_id, 0) |
| OLD | NEW |