Beispiel #1
0
    def test_jetpack_core(self):
        # this has a side-effect of asserting that all the SDK's api-utils
        # modules are clean.
        jp_core = "packages/api-utils/lib"
        assert os.path.isdir(jp_core)  # we expect to be run from the SDK top
        stderr = StringIO()
        manifest, has_problems = scan_package("prefix-", "resource:foo/", "api-utils", "lib", jp_core, stderr)
        stderr.seek(0)
        err = stderr.readlines()
        self.failUnlessEqual(err, [], "".join(err))
        self.failUnlessEqual(has_problems, False)
        update_manifest_with_fileinfo(["api-utils"], "api-utils", manifest)

        # look at a few samples from the manifest: this depends upon the
        # behavior of other files in the SDK, so when those files change
        # (specifically when they move or add dependencies), this test must
        # be updated
        self.failUnless("resource:foo/tab-browser.js" in manifest, manifest.keys())
        tb = manifest["resource:foo/tab-browser.js"]
        self.failUnlessEqual(tb.chrome, True)
        self.failUnlessEqual(tb.name, "tab-browser")
        self.failUnlessEqual(tb.packageName, "api-utils")
        self.failUnless("window-utils" in tb.requires, tb.requires.values())
        self.failUnlessEqual(tb.requires["window-utils"].url, "resource:foo/window-utils.js")
        self.failUnlessEqual(tb.sectionName, "lib")
        self.failUnlessEqual(tb.zipname, "resources/prefix-api-utils-lib/tab-browser.js")
        h = tb.hash
        self.failUnless(re.search(r"^[0-9a-f]{64}$", h), h)
        # don't assert the actual value, since that will change each time
        # page-mod.js changes

        self.failUnless("resource:foo/api-utils.js" in manifest, manifest.keys())
Beispiel #2
0
 def test_e10s_adapter(self):
     path = "python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib"
     manifest, has_problems = scan_package("prefix-", "resource:foo/", "foo", "lib", path)
     update_manifest_with_fileinfo(["foo"], "foo", manifest)
     self.assertEqual(manifest["resource:foo/bar.js"]["e10s-adapter"], "resource:foo/bar-e10s-adapter.js")
     self.assertFalse(manifest["resource:foo/bar-e10s-adapter.js"]["e10s-adapter"])
     self.assertFalse(manifest["resource:foo/foo.js"]["e10s-adapter"])
Beispiel #3
0
 def test_bug_596573(self):
     jp_tests = "packages/api-utils/tests"
     manifest, has_problems = scan_package("prefix", "resource:foo", "api-utils", "tests", jp_tests)
     found = [
         i.name for i in manifest.values() if i.name == "interoperablejs-read-only/compliance/" + "nested/a/b/c/d"
     ]
     self.failUnless(len(found) == 1)
Beispiel #4
0
 def test_bug_596573(self):
     jp_tests = "packages/jetpack-core/tests"
     manifest, has_problems = scan_package("tests", jp_tests)
     found = [modname
              for pkgname, modname, deps, needschrome in manifest
              if modname == "interoperablejs-read-only/compliance/" +
                            "nested/a/b/c/d"]
     self.failUnless(len(found) == 1)
Beispiel #5
0
 def test_bug_596573(self):
     jp_tests = "packages/api-utils/tests"
     manifest, has_problems = scan_package("tests", jp_tests)
     found = [
         modname for pkgname, modname, deps, needschrome in manifest
         if modname == "interoperablejs-read-only/compliance/" +
         "nested/a/b/c/d"
     ]
     self.failUnless(len(found) == 1)
 def test_bug_596573(self):
     jp_tests = "packages/api-utils/tests"
     manifest, has_problems = scan_package("prefix", "resource:foo",
                                           "api-utils", "tests", jp_tests)
     found = [
         i.name for i in manifest.values()
         if i.name == "interoperablejs-read-only/compliance/" +
         "nested/a/b/c/d"
     ]
     self.failUnless(len(found) == 1)
 def test_e10s_adapter(self):
     path = "python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib"
     manifest, has_problems = scan_package("prefix-", "resource:foo/",
                                           "foo", "lib", path)
     update_manifest_with_fileinfo(["foo"], "foo", manifest)
     self.assertEqual(manifest['resource:foo/bar.js']['e10s-adapter'],
                      'resource:foo/bar-e10s-adapter.js')
     self.assertFalse(
         manifest['resource:foo/bar-e10s-adapter.js']['e10s-adapter'])
     self.assertFalse(manifest['resource:foo/foo.js']['e10s-adapter'])
Beispiel #8
0
 def test_jetpack_core(self):
     # this has a side-effect of asserting that all the SDK's jetpack-core
     # modules are clean.
     jp_core = "packages/jetpack-core/lib"
     assert os.path.isdir(jp_core) # we expect to be run from the SDK top
     stderr = StringIO()
     manifest, has_problems = scan_package("jetpack-core", jp_core, stderr)
     stderr.seek(0)
     err = stderr.readlines()
     self.failUnlessEqual(err, [], "".join(err))
     self.failUnlessEqual(has_problems, False)
Beispiel #9
0
 def test_jetpack_core(self):
     # this has a side-effect of asserting that all the SDK's api-utils
     # modules are clean.
     jp_core = "packages/api-utils/lib"
     assert os.path.isdir(jp_core)  # we expect to be run from the SDK top
     stderr = StringIO()
     manifest, has_problems = scan_package("api-utils", jp_core, stderr)
     stderr.seek(0)
     err = stderr.readlines()
     self.failUnlessEqual(err, [], "".join(err))
     self.failUnlessEqual(has_problems, False)
    def test_jetpack_core(self):
        # this has a side-effect of asserting that all the SDK's api-utils
        # modules are clean.
        jp_core = "packages/api-utils/lib"
        assert os.path.isdir(jp_core)  # we expect to be run from the SDK top
        stderr = StringIO()
        manifest, has_problems = scan_package("prefix-", "resource:foo/",
                                              "api-utils", "lib", jp_core,
                                              stderr)
        stderr.seek(0)
        err = stderr.readlines()
        self.failUnlessEqual(err, [], "".join(err))
        self.failUnlessEqual(has_problems, False)
        update_manifest_with_fileinfo(["api-utils"], "api-utils", manifest)

        # look at a few samples from the manifest: this depends upon the
        # behavior of other files in the SDK, so when those files change
        # (specifically when they move or add dependencies), this test must
        # be updated
        self.failUnless("resource:foo/tab-browser.js" in manifest,
                        manifest.keys())
        tb = manifest["resource:foo/tab-browser.js"]
        self.failUnlessEqual(tb.chrome, True)
        self.failUnlessEqual(tb.name, "tab-browser")
        self.failUnlessEqual(tb.packageName, "api-utils")
        self.failUnless("window-utils" in tb.requires, tb.requires.values())
        self.failUnlessEqual(tb.requires["window-utils"].url,
                             "resource:foo/window-utils.js")
        self.failUnlessEqual(tb.sectionName, "lib")
        self.failUnlessEqual(tb.zipname,
                             "resources/prefix-api-utils-lib/tab-browser.js")
        h = tb.hash
        self.failUnless(re.search(r'^[0-9a-f]{64}$', h), h)
        # don't assert the actual value, since that will change each time
        # page-mod.js changes

        self.failUnless("resource:foo/api-utils.js" in manifest,
                        manifest.keys())