]> git.decadent.org.uk Git - dak.git/blob - tests/test_architecture.py
Merge remote-tracking branch 'jcristau/formatone-no-tar-sig'
[dak.git] / tests / test_architecture.py
1 #! /usr/bin/python
2 #
3 # Copyright (C) 2014, Ansgar Burchardt <ansgar@debian.org>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19 from base_test import DakTestCase
20
21 import unittest
22
23 from daklib.architecture import match_architecture
24
25 class MatchArchitecture(DakTestCase):
26     def testEqual(self):
27         self.assert_(match_architecture('amd64', 'amd64'))
28         self.assert_(match_architecture('linux-amd64', 'linux-amd64'))
29         self.assert_(match_architecture('linux-amd64', 'amd64'))
30         self.assert_(match_architecture('amd64', 'linux-amd64'))
31         self.assert_(not match_architecture('amd64', 'i386'))
32         self.assert_(match_architecture('kfreebsd-amd64', 'kfreebsd-amd64'))
33         self.assert_(not match_architecture('kfreebsd-amd64', 'amd64'))
34     def testAny(self):
35         self.assert_(match_architecture('amd64', 'any'))
36         self.assert_(match_architecture('amd64', 'any-amd64'))
37         self.assert_(match_architecture('x32', 'any-amd64'))
38         self.assert_(match_architecture('kfreebsd-amd64', 'any-amd64'))
39         self.assert_(not match_architecture('amd64', 'any-i386'))
40
41         self.assert_(match_architecture('kfreebsd-amd64', 'kfreebsd-any'))
42         self.assert_(not match_architecture('amd64', 'kfreebsd-any'))
43     def testAll(self):
44         self.assert_(match_architecture('all', 'all'))
45
46         self.assert_(not match_architecture('amd64', 'all'))
47         self.assert_(not match_architecture('all', 'amd64'))
48
49         self.assert_(not match_architecture('all', 'any'))
50
51 if __name__ == '__main__':
52     unittest.main()