Ejemplo n.º 1
0
    def test_files_bug_component_final(self):
        reader = self.reader("files-info")

        v = reader.files_info([
            "bug_component/final/foo",
            "bug_component/final/Makefile.in",
            "bug_component/final/subcomponent/Makefile.in",
            "bug_component/final/subcomponent/bar",
        ])

        self.assertEqual(
            v["bug_component/final/foo"]["BUG_COMPONENT"],
            BugzillaComponent("default_product", "default_component"),
        )
        self.assertEqual(
            v["bug_component/final/Makefile.in"]["BUG_COMPONENT"],
            BugzillaComponent("Firefox Build System", "General"),
        )
        self.assertEqual(
            v["bug_component/final/subcomponent/Makefile.in"]["BUG_COMPONENT"],
            BugzillaComponent("Firefox Build System", "General"),
        )
        self.assertEqual(
            v["bug_component/final/subcomponent/bar"]["BUG_COMPONENT"],
            BugzillaComponent("Another", "Component"),
        )
Ejemplo n.º 2
0
    def test_files_bug_component_static(self):
        reader = self.reader('files-info')

        v = reader.files_info(['bug_component/static/foo',
                               'bug_component/static/bar',
                               'bug_component/static/foo/baz'])
        self.assertEqual(len(v), 3)
        self.assertEqual(v['bug_component/static/foo']['BUG_COMPONENT'],
                         BugzillaComponent('FooProduct', 'FooComponent'))
        self.assertEqual(v['bug_component/static/bar']['BUG_COMPONENT'],
                         BugzillaComponent('BarProduct', 'BarComponent'))
        self.assertEqual(v['bug_component/static/foo/baz']['BUG_COMPONENT'],
                         BugzillaComponent('default_product', 'default_component'))
Ejemplo n.º 3
0
    def test_files_bug_component_different_matchers(self):
        reader = self.reader('files-info')

        v = reader.files_info([
            'bug_component/different-matchers/foo.jsm',
            'bug_component/different-matchers/bar.cpp',
            'bug_component/different-matchers/baz.misc'])
        self.assertEqual(len(v), 3)

        js_flags = v['bug_component/different-matchers/foo.jsm']
        cpp_flags = v['bug_component/different-matchers/bar.cpp']
        misc_flags = v['bug_component/different-matchers/baz.misc']

        self.assertEqual(js_flags['BUG_COMPONENT'], BugzillaComponent('Firefox', 'JS'))
        self.assertEqual(cpp_flags['BUG_COMPONENT'], BugzillaComponent('Firefox', 'C++'))
        self.assertEqual(misc_flags['BUG_COMPONENT'], BugzillaComponent('default_product', 'default_component'))
Ejemplo n.º 4
0
    def test_files_bug_component_final(self):
        reader = self.reader('files-info')

        v = reader.files_info([
            'bug_component/final/foo',
            'bug_component/final/Makefile.in',
            'bug_component/final/subcomponent/Makefile.in',
            'bug_component/final/subcomponent/bar'])

        self.assertEqual(v['bug_component/final/foo']['BUG_COMPONENT'],
                         BugzillaComponent('default_product', 'default_component'))
        self.assertEqual(v['bug_component/final/Makefile.in']['BUG_COMPONENT'],
                         BugzillaComponent('Firefox Build System', 'General'))
        self.assertEqual(v['bug_component/final/subcomponent/Makefile.in']['BUG_COMPONENT'],
                         BugzillaComponent('Firefox Build System', 'General'))
        self.assertEqual(v['bug_component/final/subcomponent/bar']['BUG_COMPONENT'],
                         BugzillaComponent('Another', 'Component'))
Ejemplo n.º 5
0
    def test_files_bug_component_static(self):
        reader = self.reader("files-info")

        v = reader.files_info([
            "bug_component/static/foo",
            "bug_component/static/bar",
            "bug_component/static/foo/baz",
        ])
        self.assertEqual(len(v), 3)
        self.assertEqual(
            v["bug_component/static/foo"]["BUG_COMPONENT"],
            BugzillaComponent("FooProduct", "FooComponent"),
        )
        self.assertEqual(
            v["bug_component/static/bar"]["BUG_COMPONENT"],
            BugzillaComponent("BarProduct", "BarComponent"),
        )
        self.assertEqual(
            v["bug_component/static/foo/baz"]["BUG_COMPONENT"],
            BugzillaComponent("default_product", "default_component"),
        )
Ejemplo n.º 6
0
    def test_files_bug_component_different_matchers(self):
        reader = self.reader("files-info")

        v = reader.files_info([
            "bug_component/different-matchers/foo.jsm",
            "bug_component/different-matchers/bar.cpp",
            "bug_component/different-matchers/baz.misc",
        ])
        self.assertEqual(len(v), 3)

        js_flags = v["bug_component/different-matchers/foo.jsm"]
        cpp_flags = v["bug_component/different-matchers/bar.cpp"]
        misc_flags = v["bug_component/different-matchers/baz.misc"]

        self.assertEqual(js_flags["BUG_COMPONENT"],
                         BugzillaComponent("Firefox", "JS"))
        self.assertEqual(cpp_flags["BUG_COMPONENT"],
                         BugzillaComponent("Firefox", "C++"))
        self.assertEqual(
            misc_flags["BUG_COMPONENT"],
            BugzillaComponent("default_product", "default_component"),
        )