selftest.py: Add selftest.target.samba with bindir_path function.
[idra/samba.git] / selftest / tests / test_samba.py
1 # test_run.py -- Tests for selftest.target.samba
2 # Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; version 3
7 # of the License or (at your option) any later version of
8 # the License.
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
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 # MA  02110-1301, USA.
19
20 """Tests for selftest.target.samba."""
21
22 from selftest.tests import TestCase
23
24 from selftest.target.samba import bindir_path
25
26
27 class BinDirPathTests(TestCase):
28
29     def test_mapping(self):
30         self.assertEquals("exe4",
31             bindir_path({"exe": "exe4"}, "/some/path", "exe"))
32         self.assertEquals("/bin/ls",
33             bindir_path({"exe": "ls"}, "/bin", "exe"))
34
35     def test_no_mapping(self):
36         self.assertEquals("exe", bindir_path({}, "/some/path", "exe"))
37         self.assertEquals("/bin/ls",
38             bindir_path({}, "/bin", "ls"))