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

Side by Side Diff: mojo/tools/testing/mojom_fetcher/mojom_directory_tests.py

Issue 1709333002: Remove mojom_fetcher. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 import os.path
6 import unittest
7
8 from fakes import FakeMojomFile
9 from fetcher.dependency import Dependency
10 from fetcher.mojom_directory import MojomDirectory
11 from fetcher.mojom_file import MojomFile
12 from fetcher.repository import Repository
13
14
15 class TestMojomDirectory(unittest.TestCase):
16 def test_build_gn_path(self):
17 directory = MojomDirectory(
18 "/base/repo/third_party/external/domokit.org/bar/baz")
19 self.assertEquals(
20 "/base/repo/third_party/external/domokit.org/bar/baz/BUILD.gn",
21 directory.get_build_gn_path())
22
23 def test_jinja_parameters(self):
24 mojom = FakeMojomFile(
25 Repository("/base/repo", "third_party/external"),
26 "/base/repo/third_party/external/domokit.org/bar/baz/foo.mojom")
27 mojom.add_dependency("example.com/dir/example.mojom")
28 mojom.add_dependency("example.com/dir/dir.mojom")
29 mojom.add_dependency("buzz.mojom")
30 mojom.add_dependency("foo/bar.mojom")
31 mojom.add_dependency(
32 "mojo/public/interfaces/application/shell.mojom")
33 directory = MojomDirectory(
34 "/base/repo/third_party/external/domokit.org/bar/baz")
35 directory.add_mojom(mojom)
36 params = directory.get_jinja_parameters([])
37 self.assertEquals(
38 {"group_name": "baz",
39 "mojoms": [{
40 "target_name": "foo",
41 "filename": "foo.mojom",
42 "import_dirs": [".."],
43 "mojo_sdk_deps": ["mojo/public/interfaces/application"],
44 "deps": [
45 '//third_party/external/example.com/dir:example',
46 '//third_party/external/example.com/dir:dir_mojom',
47 ':buzz',
48 '../foo:bar']
49 }]}, params)
50
OLDNEW
« no previous file with comments | « mojo/tools/testing/mojom_fetcher/fakes.py ('k') | mojo/tools/testing/mojom_fetcher/mojom_fetcher_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698