Environment detection & logging on startup

Incl. OctoPi version & RPi model through bundled plugin that only
gets loaded if OctoPi is detected.
This commit is contained in:
Gina Häußge committed 2017-11-10 17:32:59 +01:00
1 parent 0bb343e1d3
commit b2d70de144
19 files changed
+494 -53

No files matched your search

-17
View File
@@ -42,20 +42,3 @@ class PluginManagerPluginTests(unittest.TestCase):
with mock.patch("sys.platform", sys_platform):
actual = PluginManagerPlugin._is_os_compatible(current_os, entries)
self.assertEqual(actual, expected)
@ddt.data(
("win32", "windows"),
("linux2", "linux"),
("darwin", "macos"),
("linux", "linux"),
("linux3", "linux"),
("freebsd", "freebsd"),
("freebsd2342", "freebsd"),
("os2", "unmapped"),
("sunos5", "unmapped")
)
@ddt.unpack
def test_get_os(self, sys_platform, expected):
with mock.patch("sys.platform", sys_platform):
actual = PluginManagerPlugin._get_os()
self.assertEqual(actual, expected)
+30
View File
@@ -0,0 +1,30 @@
# coding=utf-8
from __future__ import absolute_import
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
import unittest
import ddt
import mock
@ddt.ddt
class PlatformUtilTest(unittest.TestCase):
@ddt.data(
("win32", "windows"),
("linux2", "linux"),
("darwin", "macos"),
("linux", "linux"),
("linux3", "linux"),
("freebsd", "freebsd"),
("freebsd2342", "freebsd"),
("os2", "unmapped"),
("sunos5", "unmapped")
)
@ddt.unpack
def test_get_os(self, sys_platform, expected):
with mock.patch("sys.platform", sys_platform):
from octoprint.util.platform import get_os
actual = get_os()
self.assertEqual(actual, expected)