-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_installer.py
More file actions
42 lines (32 loc) · 1.31 KB
/
test_installer.py
File metadata and controls
42 lines (32 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from ricedb.rice import installer, package
import unittest, os
class testInstaller(unittest.TestCase):
"""
Testing the Rice download and installer methods
"""
def setUp(self):
self.test_package_data = {
'name': 'test1',
'program': 'i3',
'upstream': 'http://github.com/install-logos/example-repo.git'
}
self.test_package = package.Package(self.test_package_data)
def test_download(self):
i3_test = installer.Installer(self.test_package)
i3_test.download()
self.assertTrue(os.path.exists(os.path.expanduser("~/.rdb/i3/test1")))
self.assertTrue(os.path.isdir(os.path.expanduser("~/.rdb/i3/test1")))
def test_install(self):
i3_test = installer.Installer(self.test_package)
i3_test.download()
i3_test.install(force=True)
self.assertTrue(os.path.exists(os.path.expanduser("~/.rdb/i3/test1/file1.conf")))
self.assertTrue(os.path.exists(os.path.expanduser("~/.rdb/i3/test1/install.json")))
self.assertTrue(os.path.exists(os.path.expanduser("~/.i3/file2.conf")))
def tearDown(self):
os.system("rm -rf ~/.rdb/i3/test1/")
# Add in Query Return Test
# Add in Package Initialization Test
# Entire Pipeline should be tested
if __name__ == "__main__":
unittest.main()