File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def create_new_snapshot(
75
75
json .dumps (snapshot_json ),
76
76
)
77
77
78
- if api_call == dict () or api_call .get ("id" ) is None :
78
+ if api_call == dict () or ( api_call .get ("id" ) is None and api_call . get ( "key" ) is None ) :
79
79
logging .error (f"Check the error: { api_call } ." )
80
80
raise Exception
81
81
else :
Original file line number Diff line number Diff line change 25
25
"License :: OSI Approved" ,
26
26
"Operating System :: OS Independent" ,
27
27
],
28
+ license = "Apache-2.0 License" ,
28
29
packages = ["grafana_api" ],
29
30
install_requires = ["httpx" ],
30
31
extras_require = {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def test_a_create_new_snapshot(self):
21
21
self .dashboard .get_dashboard_by_uid ("tests" ).get ("dashboard" ),
22
22
name = "TestSnapshot1" ,
23
23
)
24
- self .assertIsNotNone (snapshot .get ("id " ))
24
+ self .assertIsNotNone (snapshot .get ("key " ))
25
25
26
26
def test_get_snapshots (self ):
27
27
self .assertEqual (1 , len (self .snapshot .get_snapshots ()))
@@ -32,12 +32,13 @@ def test_get_snapshot_by_key(self):
32
32
self .snapshot .get_snapshot_by_key (snapshot_key ).get ("dashboard" ).get ("id" )
33
33
)
34
34
35
- def test_b_delete_snapshot_by_key (self ):
35
+ def test_d_delete_snapshot_by_key (self ):
36
+ print (self .snapshot .get_snapshots ())
36
37
snapshot_key : str = self .snapshot .get_snapshots ()[1 ].get ("key" )
37
38
self .snapshot .delete_snapshot_by_key (snapshot_key )
38
39
self .assertEqual (1 , len (self .snapshot .get_snapshots ()))
39
40
40
- def test_c_delete_snapshot_by_delete_key (self ):
41
+ def test_e_delete_snapshot_by_delete_key (self ):
41
42
snapshot : dict = self .snapshot .create_new_snapshot (
42
43
self .dashboard .get_dashboard_by_uid ("tests" ).get ("dashboard" ),
43
44
name = "TestSnapshot2" ,
You can’t perform that action at this time.
0 commit comments