]> git.donarmstrong.com Git - dak.git/blob - tests/test_architecture.py
Drop unique .changes name requirement and allow ftpteam to forget seen files.
[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_(not match_architecture('amd64', 'i386'))
29         self.assert_(match_architecture('kfreebsd-amd64', 'kfreebsd-amd64'))
30         self.assert_(not match_architecture('kfreebsd-amd64', 'amd64'))
31     def testAny(self):
32         self.assert_(match_architecture('amd64', 'any'))
33         self.assert_(match_architecture('amd64', 'any-amd64'))
34         self.assert_(match_architecture('x32', 'any-amd64'))
35         self.assert_(match_architecture('kfreebsd-amd64', 'any-amd64'))
36         self.assert_(not match_architecture('amd64', 'any-i386'))
37
38         self.assert_(match_architecture('kfreebsd-amd64', 'kfreebsd-any'))
39         self.assert_(not match_architecture('amd64', 'kfreebsd-any'))
40     def testAll(self):
41         self.assert_(match_architecture('all', 'all'))
42
43         self.assert_(not match_architecture('amd64', 'all'))
44         self.assert_(not match_architecture('all', 'amd64'))
45
46         self.assert_(not match_architecture('all', 'any'))
47
48 if __name__ == '__main__':
49     unittest.main()