@@ -14,7 +14,6 @@ class ServiceAccountTest(TestCase):
14
14
http2_support = True if os .environ ["HTTP2" ] == "True" else False ,
15
15
)
16
16
service_account : ServiceAccount = ServiceAccount (grafana_api_model = model )
17
- authentication : Authentication = Authentication (grafana_api_model = model )
18
17
19
18
def test_lifecycle_service_account (self ):
20
19
service_account : dict = self .service_account .create_service_account (
@@ -64,36 +63,14 @@ def test_lifecycle_service_account(self):
64
63
service_account .get ("id" )
65
64
),
66
65
)
67
- self .authentication .create_api_token ("Test-all-migrated" , "Viewer" )
68
66
self .service_account .migrate_api_keys_to_service_accounts ()
69
- self .assertEqual (list (), self .authentication .get_api_tokens ())
70
67
self .assertEqual (
71
- 3 , len (self .service_account .search_service_account ().get ("serviceAccounts" ))
72
- )
73
- service_account_all_migrated : dict = (
74
- self .service_account .search_service_account (query = "Test-all-migrated" )
75
- )
76
- self .service_account .delete_service_account (
77
- service_account_all_migrated .get ("serviceAccounts" )[0 ].get ("id" )
78
- )
79
-
80
- token : dict = self .authentication .create_api_token ("Test-migrated" , "Viewer" )
81
- self .service_account .migrate_api_key_to_service_account (token .get ("id" ))
82
- self .assertEqual (
83
- 3 , len (self .service_account .search_service_account ().get ("serviceAccounts" ))
84
- )
85
- service_account_migrated : dict = self .service_account .search_service_account (
86
- query = "Test-migrated"
68
+ 2 , len (self .service_account .search_service_account ().get ("serviceAccounts" ))
87
69
)
88
70
89
- self .assertEqual (
90
- 3 , len (self .service_account .search_service_account ().get ("serviceAccounts" ))
91
- )
71
+ #TODO Add the APi token functionality
92
72
93
73
self .service_account .delete_service_account (service_account .get ("id" ))
94
- self .service_account .delete_service_account (
95
- service_account_migrated .get ("serviceAccounts" )[0 ].get ("id" )
96
- )
97
74
self .assertEqual (
98
75
1 , len (self .service_account .search_service_account ().get ("serviceAccounts" ))
99
76
)
0 commit comments