root/branches/mk/tests/unit/test_index_install.py

Revision 93, 1.2 kB (checked in by mk, 6 years ago)

Use raw index class name as index name.

Line 
1 import os
2
3 import _path_cheesecake
4 from _helper_cheesecake import DATA_PATH
5 from cheesecake.cheesecake_index import Cheesecake
6
7
8 class TestIndexInstall(object):
9     def setUp(self):
10         self.cheesecake = None
11
12     def tearDown(self):
13         if not self.cheesecake:
14             return
15         self.cheesecake.cleanup()
16
17     def test_index_install_correct_package(self):
18         self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "nose-0.8.3.tar.gz"))
19
20         index = self.cheesecake.index["INSTALLABILITY"]["IndexInstall"]
21         index.compute_with(self.cheesecake)
22
23         assert index.name == "IndexInstall"
24         assert index.value == index.max_value
25         assert index.details == "package installed in " + self.cheesecake.sandbox_install_dir
26
27     def test_index_install_incorrect_package(self):
28         self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz"))
29
30         index = self.cheesecake.index["INSTALLABILITY"]["IndexInstall"]
31         index.compute_with(self.cheesecake)
32
33         assert index.name == "IndexInstall"
34         assert index.value == 0
35         assert index.details == "could not install package in " + self.cheesecake.sandbox_install_dir
Note: See TracBrowser for help on using the browser.