@@ -25,7 +25,7 @@ class TBClientPETests(unittest.TestCase):
25
25
@classmethod
26
26
def setUpClass (cls ) -> None :
27
27
# ThingsBoard REST API URL
28
- url = "https ://127.0.0.1:8080"
28
+ url = "http ://127.0.0.1:8080"
29
29
30
30
# Default Tenant Administrator credentials
31
31
@@ -56,8 +56,6 @@ def test_get_device_publish_telemetry_commands(self):
56
56
self .assertIsInstance (self .client .get_device_publish_telemetry_commands (self .device .id ), dict )
57
57
58
58
class AdminControllerTests (TBClientPETests ):
59
- def test_get_authorization_url (self ):
60
- self .assertIsInstance (self .client .get_authorization_url (), str )
61
59
62
60
def test_get_mail_processing_url (self ):
63
61
self .assertIsInstance (self .client .get_mail_processing_url (), str )
@@ -386,7 +384,8 @@ def test_get_audit_logs_by_user_id(self):
386
384
387
385
388
386
class EntityGroupControllerTests (TBClientPETests ):
389
- test_entity_group = None
387
+ test_entity_group : EntityGroup = None
388
+ asset_profile_id = None
390
389
test_asset = None
391
390
customer = None
392
391
user = None
@@ -407,10 +406,14 @@ def setUpClass(cls) -> None:
407
406
cls .test_entity_group = EntityGroup (name = 'Test 4' , type = 'ASSET' )
408
407
cls .test_entity_group = cls .client .save_entity_group (cls .test_entity_group )
409
408
410
- cls .test_asset = cls .client .get_tenant_assets (10 , 0 ).data [0 ]
409
+ cls .asset_profile_id = cls .client .get_default_asset_profile_info ().id
410
+ cls .test_asset = Asset (name = "Test Asset" , asset_profile_id = cls .asset_profile_id )
411
+ cls .test_asset = cls .client .save_asset (body = cls .test_asset ,
412
+ entity_group_id = cls .test_entity_group .id )
411
413
412
414
@classmethod
413
415
def tearDownClass (cls ) -> None :
416
+ cls .client .delete_asset (cls .test_asset .id )
414
417
cls .client .delete_entity_group (cls .test_entity_group .id )
415
418
cls .client .delete_role (cls .role .id )
416
419
@@ -457,7 +460,6 @@ def test_get_entity_group_by_id(self):
457
460
self .client .get_entity_group_by_id (self .test_entity_group .id ),
458
461
EntityGroupInfo )
459
462
460
- @unittest .skip ('ThingsBoard json naming bug' )
461
463
def test_get_owners (self ):
462
464
self .assertIsInstance (self .client .get_owners (1 , 0 ), PageDataContactBasedobject )
463
465
@@ -466,17 +468,13 @@ def test_share_entity_group_to_child_owner_user_group(self):
466
468
self .client .share_entity_group_to_child_owner_user_group (self .test_entity_group .id , self .user_group .id ,
467
469
self .role .id ), None )
468
470
469
- @unittest .skip ('ThingsBoard json naming bug' )
470
471
def test_get_entities (self ):
471
- self .assertIsInstance (
472
- self .client .get_entities (EntityGroupId ('4fe07130-edfd-11eb-91fd-1f8899a6f9b3' , 'ENTITY_GROUP' ), 10 , 0 ),
473
- PageDataShortEntityView )
472
+ self .assertIsInstance (self .client .get_entities (self .test_entity_group .id , 10 , 0 ),
473
+ PageDataShortEntityView )
474
474
475
- @unittest .skip ('ThingsBoard json naming bug' )
476
475
def test_get_group_entity (self ):
477
- self .assertIsInstance (
478
- self .client .get_group_entity (EntityGroupId ('4fe07130-edfd-11eb-91fd-1f8899a6f9b3' ),
479
- EntityId ('7731eb20-1894-11ed-b864-31da2039250b' , 'ASSET' )), ShortEntityView )
476
+ self .assertIsInstance (self .client .get_group_entity (self .test_entity_group .id , self .test_asset .id ),
477
+ ShortEntityView )
480
478
481
479
482
480
class CustomerControllerTests (TBClientPETests ):
@@ -727,7 +725,7 @@ def test_ack_alarm(self):
727
725
728
726
def test_get_alarm_by_id (self ):
729
727
self .assertIsInstance (self .client .get_alarm_by_id (self .test_alarm .id ), Alarm )
730
-
728
+
731
729
def test_get_alarm_types_using_get (self ):
732
730
self .assertIsInstance (self .client .get_alarm_types (10 , 0 ), PageDataEntitySubtype )
733
731
0 commit comments