-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #273 from NebraLtd/shawaj/testsbc
sbc: add test cases
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import unittest | ||
|
||
from unittest.mock import patch | ||
from hm_pyhelper.sbc import is_commercial_fleet, is_nebra_fleet | ||
|
||
|
||
class TestSBC(unittest.TestCase): | ||
|
||
@patch.dict('os.environ', {"BALENA_API_URL": "https://api.cloud.nebra.com"}) | ||
@patch.dict('os.environ', {"BALENA_APP_ID": "55"}) | ||
def test_is_nebra_fleet_true(self): | ||
self.assertTrue(is_nebra_fleet()) | ||
|
||
@patch.dict('os.environ', {"BALENA_API_URL": "https://test.com"}) | ||
@patch.dict('os.environ', {"BALENA_APP_ID": "5500"}) | ||
def test_is_nebra_fleet_false(self): | ||
self.assertFalse(is_nebra_fleet()) | ||
|
||
@patch.dict('os.environ', {"BALENA_APP_NAME": "test-c"}) | ||
@patch.dict('os.environ', {"BALENA_APP_ID": "87"}) | ||
def test_is_commercial_fleet_true(self): | ||
self.assertTrue(is_commercial_fleet()) | ||
|
||
@patch.dict('os.environ', {"BALENA_APP_NAME": "test"}) | ||
@patch.dict('os.environ', {"BALENA_APP_ID": "8700"}) | ||
def test_is_commercial_fleet_false(self): | ||
self.assertFalse(is_commercial_fleet()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "hm_pyhelper" | ||
version = "0.14.18" | ||
version = "0.14.19" | ||
description = "Helium Python Helper" | ||
authors = ["Nebra Ltd <[email protected]>"] | ||
readme = "README.md" | ||
|