Only update sys.path when installing with --home
[zeroinstall/zeroinstall-afb.git] / tests / testarch.py
blobe30e05cf26c132a2fb7c83bd9ecaaa29d7fd4913
1 #!/usr/bin/env python
2 from basetest import BaseTest, empty_feed
3 import sys, os
4 import unittest
6 sys.path.insert(0, '..')
7 from zeroinstall.injector.arch import get_architecture
9 class TestArch(BaseTest):
11 def setUp(self):
12 BaseTest.setUp(self)
14 def tearDown(self):
15 BaseTest.tearDown(self)
17 def testDefault(self):
18 arch = get_architecture(None, None)
19 assert arch
21 def testOs(self):
22 arch = get_architecture('MacOSX', 'ppc')
23 assert ('Darwin' in arch.os_ranks)
25 def testMachine(self):
26 arch = get_architecture('Linux', 'i686')
27 assert ('i386' in arch.machine_ranks)
29 if __name__ == '__main__':
30 unittest.main()