コード例 #1
0
 def test_Packages_file_empty_with_no_deb_content(self):
     package1 = DummyFetchedPackage("foo", "1.1", no_content=True)
     package2 = DummyFetchedPackage("bar", "1.1", no_content=True)
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1, package2])
     tf = self.get_tarfile(hwpack)
     self.assertThat(tf, HardwarePackHasFile("pkgs/Packages", content=""))
コード例 #2
0
 def test_Packages_file_correct_content_with_some_deb_content(self):
     package1 = DummyFetchedPackage("foo", "1.1", no_content=True)
     package2 = DummyFetchedPackage("bar", "1.1")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1, package2])
     tf = self.get_tarfile(hwpack)
     self.assertThat(tf, HardwarePackHasFile("pkgs/Packages", content=get_packages_file([package2])))
コード例 #3
0
 def test_manifest_contains_package_info(self):
     package1 = DummyFetchedPackage("foo", "1.1")
     package2 = DummyFetchedPackage("bar", "1.2")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1, package2])
     tf = self.get_tarfile(hwpack)
     self.assertThat(tf, HardwarePackHasFile("manifest", content="foo=1.1\nbar=1.2\n"))
コード例 #4
0
 def test_add_packages_without_content_leaves_out_debs(self):
     package1 = DummyFetchedPackage("foo", "1.1", no_content=True)
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1])
     tf = self.get_tarfile(hwpack)
     self.assertThat(
         tf, Not(HardwarePackHasFile("pkgs/%s" % package1.filename)))
コード例 #5
0
 def test_adds_multiple_packages_at_once(self):
     package1 = DummyFetchedPackage("foo", "1.1")
     package2 = DummyFetchedPackage("bar", "1.1")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1, package2])
     tf = self.get_tarfile(hwpack)
     self.assertThat(tf, HardwarePackHasFile("pkgs/%s" % package1.filename, content=package1.content.read()))
     self.assertThat(tf, HardwarePackHasFile("pkgs/%s" % package2.filename, content=package2.content.read()))
コード例 #6
0
 def test_manifest_contains_package_info(self):
     package1 = DummyFetchedPackage("foo", "1.1")
     package2 = DummyFetchedPackage("bar", "1.2")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1, package2])
     tf = self.get_tarfile(hwpack)
     self.assertThat(
         tf, HardwarePackHasFile("manifest", content="foo=1.1\nbar=1.2\n"))
コード例 #7
0
 def test_adds_packages(self):
     package = DummyFetchedPackage("foo", "1.1")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package])
     tf = self.get_tarfile(hwpack)
     self.assertThat(
         tf,
         HardwarePackHasFile("pkgs/%s" % package.filename,
                             content=package.content.read()))
コード例 #8
0
 def test_Packages_file_correct_contents_with_packages(self):
     package1 = DummyFetchedPackage("foo", "1.1")
     package2 = DummyFetchedPackage("bar", "1.1")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1, package2])
     tf = self.get_tarfile(hwpack)
     self.assertThat(
         tf,
         HardwarePackHasFile("pkgs/Packages",
                             content=get_packages_file([package1,
                                                        package2])))
コード例 #9
0
 def test_adds_multiple_packages_at_once(self):
     package1 = DummyFetchedPackage("foo", "1.1")
     package2 = DummyFetchedPackage("bar", "1.1")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1, package2])
     tf = self.get_tarfile(hwpack)
     self.assertThat(
         tf,
         HardwarePackHasFile("pkgs/%s" % package1.filename,
                             content=package1.content.read()))
     self.assertThat(
         tf,
         HardwarePackHasFile("pkgs/%s" % package2.filename,
                             content=package2.content.read()))
コード例 #10
0
 def test_add_packages_without_content_leaves_out_debs(self):
     package1 = DummyFetchedPackage("foo", "1.1", no_content=True)
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package1])
     tf = self.get_tarfile(hwpack)
     self.assertThat(tf, Not(HardwarePackHasFile("pkgs/%s" % package1.filename)))
コード例 #11
0
 def test_adds_packages(self):
     package = DummyFetchedPackage("foo", "1.1")
     hwpack = HardwarePack(self.metadata)
     hwpack.add_packages([package])
     tf = self.get_tarfile(hwpack)
     self.assertThat(tf, HardwarePackHasFile("pkgs/%s" % package.filename, content=package.content.read()))