Kaydet (Commit) 1929b7cf authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Testler biraz elden gecirildi. Su an daha saglam bir halde. Birkac ufak isten…

Testler biraz elden gecirildi. Su an daha saglam bir halde. Birkac ufak isten sonra testlerimiz cok daha anlasilir olacak
üst 5a984fd4
......@@ -125,7 +125,7 @@ Legend:
+ ciksemel based modules rewrite with xml.dom.minidom (Zaryob)
/ partial caching and automatic resume for file download (meren)
+ use a '.part' extension
- resume file downloading (Darara.... fetcher will rewrite with httplib) (Zaryob)
- resume file downloading (Darara.... fetcher will rewrite with requests) (Zaryob)
+ search-file command (eray)
+ exception handling (eray)
+ uniform exception hierarchy
......@@ -218,7 +218,7 @@ Legend:
+ accelerate search
/ package signing
/ an embebed package signer.(aquila)
/ an embebed package signer.(Zaryob)
+ a flag to sign package after building
/ code to check if the package has a valid signature
- cli improvements
......
repos/*-bin/
repos/repo1/
repos/repo2/
repos/tmp/
inary-index.xml*
tests/
......@@ -22,64 +22,66 @@ class ComponentDBTestCase(testcase.TestCase):
def testHasComponent(self):
assert self.componentdb.has_component("system.base", "repo1")
assert not self.componentdb.has_component("floct.flict", "repo1")
assert self.componentdb.has_component("util.misc", "repo2")
assert self.componentdb.has_component("applications.network", "repo2")
assert not self.componentdb.has_component("floct.flict", "repo2")
assert self.componentdb.has_component("multimedia.graphics")
assert self.componentdb.has_component("applications.util")
def testListComponents(self):
assert set(self.componentdb.list_components("repo1")) == set(["system", "system.base",
"system.devel", "util",
"desktop", "desktop.accessibility",
"multimedia", "multimedia.graphics"])
assert set(self.componentdb.list_components("repo2")) == set(["system", "system.base",
"util", "util.admin", "util.misc"])
"applications"])
assert set(self.componentdb.list_components("repo2")) == set(["applications", "applications.util",
"applications.network"])
assert set(self.componentdb.list_components()) == set(["system", "system.base",
"applications", "applications.network",
"applications.util"])
def testGetComponent(self):
component = self.componentdb.get_component("system.base", "repo1")
assert component.name == "system.base"
assert "bash" in component.packages
assert "gnuconfig" not in component.packages
component = self.componentdb.get_component("applications.network")
assert component.name == "applications.network"
assert "ncftp" in component.packages
assert "lynx" not in component.packages
component = self.componentdb.get_component("util.misc", "repo2")
assert component.name == "util"
assert "dialog" in component.packages
assert "jpeg" not in component.packages
component = self.componentdb.get_component("applications.network", "repo2")
assert component.name == "applications.network"
assert "lynx" in component.packages
assert "ncftp" not in component.packages
def testGetUnionComponent(self):
component = self.componentdb.get_union_component("multimedia.graphics", "repo1")
assert component.name == "multimedia.graphics"
assert "jpeg" in component.packages
assert "dialog" in component.packages
component = self.componentdb.get_union_component("applications.network")
assert component.name == "applications.network"
assert "lynx" in component.packages
assert "ncftp" in component.packages
def testGetPackages(self):
packages = self.componentdb.get_packages("system.devel", "repo1")
assert "xorg-util" in packages
assert "dialog" not in packages
packages = self.componentdb.get_packages("applications.network")
assert "ncftp" in packages
assert "lynx" not in packages
packages = self.componentdb.get_packages("util.misc", "repo2")
assert "dialog" in packages
assert "jpeg" not in packages
packages = self.componentdb.get_packages("applications.network", "repo2")
assert "lynx" in packages
assert "ncftp" not in packages
#Test Walking parameter
packages = self.componentdb.get_packages("util", "repo2", walk = True)
assert "lsof" and "inxi" in packages
assert "ftp" not in packages
packages = self.componentdb.get_packages("applications", "repo2", walk = True)
assert "cpulimit" and "lynx" in packages
assert "ncftp" not in packages
def testGetUnionPackages(self):
packages = self.componentdb.get_union_packages("util", "repo1")
assert "dialog" in packages
assert "tidy" in packages
packages = self.componentdb.get_union_packages("applications.network")
assert "ncftp" in packages
assert "lynx" in packages
assert "cpulimit" not in packages
packages = self.componentdb.get_union_packages("system", 'repo1', walk = True)
assert "gnuconfig" and "ca-certificates" and "bash" in packages
packages = self.componentdb.get_union_packages("applications", walk = True)
assert "ncftp" and "lynx" and "cpulimit" in packages
def testSearchComponent(self):
packages = self.componentdb.search_component(["uti"])
assert set(packages) == set(['util', 'util.admin', 'util.misc'])
packages = self.componentdb.search_component(["applic"])
assert set(packages) == set(['applications', 'applications.network', 'applications.util'])
packages = self.componentdb.search_component(["system", "base"], repo="repo1")
assert set(packages) == set(["system.base"])
packages = self.componentdb.search_component(["system", "devel"], repo="repo2")
packages = self.componentdb.search_component(["system", "base"], repo="repo2")
assert not packages
......@@ -18,27 +18,27 @@ class FilesDBTestCase(testcase.TestCase):
filesdb = inary.db.filesdb.FilesDB()
def testHasFile(self):
assert not self.filesdb.has_file("bin/bash")
inary.api.install(["bash"])
assert self.filesdb.has_file("bin/bash")
inary.api.remove(["bash"])
assert not self.filesdb.has_file("bin/bash")
assert not self.filesdb.has_file("usr/bin/ethtool")
inary.api.install(["ethtool"])
assert self.filesdb.has_file("usr/bin/ethtool")
inary.api.remove(["ethtool"])
assert not self.filesdb.has_file("usr/bin/ethtool")
def testGetFile(self):
inary.api.install(["bash"])
pkg, path = self.filesdb.get_file("bin/bash")
assert pkg == "bash"
assert path == "bin/bash"
inary.api.remove(["bash"])
assert not self.filesdb.has_file("bin/bash")
inary.api.install(["ethtool"])
pkg, path = self.filesdb.get_file("usr/bin/ethtool")
assert pkg == "ethtool"
assert path == "usr/bin/ethtool"
inary.api.remove(["ethtool"])
assert not self.filesdb.has_file("usr/bin/ethtool")
def testAddRemoveFiles(self):
fileinfo1 = inary.files.FileInfo()
fileinfo1 = inary.data.files.FileInfo()
fileinfo1.path = "etc/inary/inary.conf"
fileinfo2 = inary.files.FileInfo()
fileinfo2 = inary.data.files.FileInfo()
fileinfo2.path = "etc/inary/mirrors.conf"
files = inary.files.Files()
files = inary.data.files.Files()
files.list.append(fileinfo1)
files.list.append(fileinfo2)
......@@ -58,11 +58,8 @@ class FilesDBTestCase(testcase.TestCase):
assert not self.filesdb.has_file("etc/inary/inary.conf")
assert not self.filesdb.has_file("etc/inary/mirrors.conf")
def testSearchFile(self):
assert not self.filesdb.search_file("bash")
inary.api.install(["bash"])
found = self.filesdb.search_file("bash")
pkg, files = found[0]
assert set(files) == set(['bin/bash'])