32
33
# get names and ...
33
34
names = bus.list_names()
34
35
# ensure we have the following:
35
# org.freedesktop.DBus,
36
# org.freedesktop.DBus,
36
37
# org.freedesktop.PolicyKit1
38
39
# (and :1.0, :1.1, :1.2)
39
40
self.assertEqual(len(names), 6)
41
42
def test_fake_aptd(self):
42
from softwarecenter.backend import get_install_backend
43
from softwarecenter.backend.installbackend import get_install_backend
43
44
backend = get_install_backend()
44
45
backend.install(Application("2vcard", ""), iconname="")
48
context = GObject.main_context_default()
50
while context.pending():
46
do_events_with_sleep()
49
class TestUtilsTestCase(unittest.TestCase):
51
def test_app_properties_helper_mock_with_defaults(self):
52
app_properties_helper = get_mock_app_properties_helper()
54
app_properties_helper.get_pkgname(None), "apkg")
56
def test_app_properties_helper_mock_with_custom_values(self):
57
my_defaults = {'pkgname': 'diemoldau',
59
app_properties_helper = get_mock_app_properties_helper(my_defaults)
61
app_properties_helper.get_pkgname(None), "diemoldau")
63
def test_url_accessable(self):
65
url_accessable("http://archive.ubuntu.com/ubuntu/", "dists/"))
67
url_accessable("http://archive.ubuntu.com/ubuntu/",
55
71
if __name__ == "__main__":