| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 unittest | 5 import unittest |
| 6 | 6 |
| 7 from loading_trace_database import LoadingTraceDatabase | 7 from cloud.common.loading_trace_database import LoadingTraceDatabase |
| 8 | 8 |
| 9 | 9 |
| 10 class LoadingTraceDatabaseUnittest(unittest.TestCase): | 10 class LoadingTraceDatabaseUnittest(unittest.TestCase): |
| 11 _JSON_DATABASE = { | 11 _JSON_DATABASE = { |
| 12 "traces/trace1.json" : { "url" : "http://bar.html", }, | 12 "traces/trace1.json" : { "url" : "http://bar.html", }, |
| 13 "traces/trace2.json" : { "url" : "http://bar.html", }, | 13 "traces/trace2.json" : { "url" : "http://bar.html", }, |
| 14 "traces/trace3.json" : { "url" : "http://qux.html", }, | 14 "traces/trace3.json" : { "url" : "http://qux.html", }, |
| 15 } | 15 } |
| 16 | 16 |
| 17 def setUp(self): | 17 def setUp(self): |
| (...skipping 18 matching lines...) Expand all Loading... |
| 36 dummy_url = "http://dummy.com" | 36 dummy_url = "http://dummy.com" |
| 37 new_trace_file = "traces/new_trace.json" | 37 new_trace_file = "traces/new_trace.json" |
| 38 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url), []) | 38 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url), []) |
| 39 self.database.SetTrace(new_trace_file, {"url" : dummy_url}) | 39 self.database.SetTrace(new_trace_file, {"url" : dummy_url}) |
| 40 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url), | 40 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url), |
| 41 [new_trace_file]) | 41 [new_trace_file]) |
| 42 | 42 |
| 43 | 43 |
| 44 if __name__ == '__main__': | 44 if __name__ == '__main__': |
| 45 unittest.main() | 45 unittest.main() |
| OLD | NEW |