FreeCAD

Форк
0
/
TestPathPreferences.py 
61 строка · 3.0 Кб
1
# -*- coding: utf-8 -*-
2
# ***************************************************************************
3
# *   Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com>               *
4
# *                                                                         *
5
# *   This program is free software; you can redistribute it and/or modify  *
6
# *   it under the terms of the GNU Lesser General Public License (LGPL)    *
7
# *   as published by the Free Software Foundation; either version 2 of     *
8
# *   the License, or (at your option) any later version.                   *
9
# *   for detail see the LICENCE text file.                                 *
10
# *                                                                         *
11
# *   This program is distributed in the hope that it will be useful,       *
12
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14
# *   GNU Library General Public License for more details.                  *
15
# *                                                                         *
16
# *   You should have received a copy of the GNU Library General Public     *
17
# *   License along with this program; if not, write to the Free Software   *
18
# *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
19
# *   USA                                                                   *
20
# *                                                                         *
21
# ***************************************************************************
22

23
import Path
24
import Tests.PathTestUtils as PathTestUtils
25

26

27
class TestPathPreferences(PathTestUtils.PathTestBase):
28
    def test00(self):
29
        """There is at least one search path."""
30

31
        paths = Path.Preferences.searchPaths()
32
        self.assertGreater(len(paths), 0)
33

34
    def test01(self):
35
        """Path/Post is part of the posts search path."""
36
        paths = Path.Preferences.searchPathsPost()
37
        self.assertEqual(len([p for p in paths if p.endswith("/Path/Post/")]), 1)
38

39
    def test02(self):
40
        """Path/Post/scripts is part of the posts search path."""
41
        paths = Path.Preferences.searchPathsPost()
42
        self.assertEqual(len([p for p in paths if p.endswith("/Path/Post/scripts/")]), 1)
43

44
    def test03(self):
45
        """Available post processors include linuxcnc, grbl and opensbp."""
46
        posts = Path.Preferences.allAvailablePostProcessors()
47
        self.assertTrue("linuxcnc" in posts)
48
        self.assertTrue("grbl" in posts)
49
        self.assertTrue("opensbp" in posts)
50

51
    def test10(self):
52
        """Default paths for tools are resolved correctly"""
53

54
        self.assertTrue(Path.Preferences.pathDefaultToolsPath().endswith("/CAM/Tools/"))
55
        self.assertTrue(Path.Preferences.pathDefaultToolsPath("Bit").endswith("/CAM/Tools/Bit"))
56
        self.assertTrue(
57
            Path.Preferences.pathDefaultToolsPath("Library").endswith("/CAM/Tools/Library")
58
        )
59
        self.assertTrue(
60
            Path.Preferences.pathDefaultToolsPath("Template").endswith("/CAM/Tools/Template")
61
        )
62

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.