3 # Copyright (C) 2014, Ansgar Burchardt <ansgar@debian.org>
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.
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.
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.
19 from base_test import DakTestCase
23 from daklib.architecture import match_architecture
25 class MatchArchitecture(DakTestCase):
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'))
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'))
41 self.assert_(match_architecture('kfreebsd-amd64', 'kfreebsd-any'))
42 self.assert_(not match_architecture('amd64', 'kfreebsd-any'))
44 self.assert_(match_architecture('all', 'all'))
46 self.assert_(not match_architecture('amd64', 'all'))
47 self.assert_(not match_architecture('all', 'amd64'))
49 self.assert_(not match_architecture('all', 'any'))
51 if __name__ == '__main__':