Skip to content

Commit

Permalink
Update test_hardware_definitions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shawaj authored Oct 27, 2024
1 parent 62ceb46 commit 69670f6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions hm_pyhelper/tests/test_hardware_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def test_is_raspberry_pi(self):
self.assertTrue(is_raspberry_pi())
# in absence of the env, it should look for /proc/device-tree/model
# which will not exist on test environment.
with self.assertRaises(FileNotFoundError):
with patch.dict(os.environ, {'BALENA_DEVICE_TYPE': "something"}):
self.assertRaises(FileNotFoundError)
self.assertFalse(is_raspberry_pi())

mock_known_rock_dts_models = ["ROCK PI 4B"]
Expand All @@ -139,7 +140,8 @@ def test_is_rock_pi(self):
self.assertTrue(is_rockpi())
# in absence of the env, it should look for /proc/device-tree/model
# which will not exist on test environment.
with self.assertRaises(FileNotFoundError):
with patch.dict(os.environ, {'BALENA_DEVICE_TYPE': "something"}):
self.assertRaises(FileNotFoundError)
self.assertFalse(is_rockpi())

mock_known_bobcat_px30_dts_models = ["Bobcat PX30"]
Expand All @@ -158,7 +160,8 @@ def test_is_bobcat_px30(self):
self.assertTrue(is_bobcat_px30())
# in absence of the env, it should look for /proc/device-tree/model
# which will not exist on test environment.
with self.assertRaises(FileNotFoundError):
with patch.dict(os.environ, {'BALENA_DEVICE_TYPE': "something"}):
self.assertRaises(FileNotFoundError)
self.assertFalse(is_bobcat_px30())

mock_known_bobcat_rk3566_dts_models = ["Rockchip RK3566 EVB2 LP4X V10 Board"]
Expand All @@ -177,7 +180,8 @@ def test_is_bobcat_rk3566(self):
self.assertTrue(is_bobcat_rk3566())
# in absence of the env, it should look for /proc/device-tree/model
# which will not exist on test environment.
with self.assertRaises(FileNotFoundError):
with patch.dict(os.environ, {'BALENA_DEVICE_TYPE': "something"}):
self.assertRaises(FileNotFoundError)
self.assertFalse(is_bobcat_rk3566())

mock_known_linxdot_rk3566_dts_models = ["Linxdot RK3566 R01"]
Expand Down

0 comments on commit 69670f6

Please sign in to comment.