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 io | 5 import io |
6 import os.path | 6 import os.path |
7 import unittest | 7 import unittest |
8 | 8 |
9 from fetcher.dependency import Dependency | 9 from fetcher.dependency import Dependency |
10 | 10 |
11 # Fake repository for testing | 11 # Fake repository for testing |
12 from fake_repository import FakeRepository | 12 from fakes import FakeRepository |
13 | 13 |
14 | 14 |
15 class TestRepository(unittest.TestCase): | 15 class TestRepository(unittest.TestCase): |
16 def test_init(self): | 16 def test_init(self): |
17 repository = FakeRepository("/path/to/repo", "third_party/external") | 17 repository = FakeRepository("/path/to/repo", "third_party/external") |
18 self.assertEqual("/path/to/repo", repository.get_repo_root_directory()) | 18 self.assertEqual("/path/to/repo", repository.get_repo_root_directory()) |
19 self.assertEqual("/path/to/repo/third_party/external", | 19 self.assertEqual("/path/to/repo/third_party/external", |
20 repository.get_external_directory()) | 20 repository.get_external_directory()) |
21 | 21 |
22 def test_get_missing_dependencies(self): | 22 def test_get_missing_dependencies(self): |
(...skipping 11 matching lines...) Expand all Loading... |
34 self.assertEquals([Dependency(repository, | 34 self.assertEquals([Dependency(repository, |
35 "/path/to/repo/third_party/external/services.domokit.org/foo/fiz.mojom", | 35 "/path/to/repo/third_party/external/services.domokit.org/foo/fiz.mojom", |
36 "services.fiz.org/foo/bar.mojom")], missing_deps) | 36 "services.fiz.org/foo/bar.mojom")], missing_deps) |
37 | 37 |
38 def test_get_external_urls(self): | 38 def test_get_external_urls(self): |
39 repository = FakeRepository("/path/to/repo", "third_party/external") | 39 repository = FakeRepository("/path/to/repo", "third_party/external") |
40 urls = repository.get_external_urls() | 40 urls = repository.get_external_urls() |
41 self.assertEquals(["/path/to/repo/third_party/external"], | 41 self.assertEquals(["/path/to/repo/third_party/external"], |
42 repository.directories_walked) | 42 repository.directories_walked) |
43 self.assertEquals(["services.domokit.org/foo/fiz.mojom"], urls) | 43 self.assertEquals(["services.domokit.org/foo/fiz.mojom"], urls) |
OLD | NEW |