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(
7575 json .dumps (snapshot_json ),
7676 )
7777
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 ) :
7979 logging .error (f"Check the error: { api_call } ." )
8080 raise Exception
8181 else :
Original file line number Diff line number Diff line change 2525 "License :: OSI Approved" ,
2626 "Operating System :: OS Independent" ,
2727 ],
28+ license = "Apache-2.0 License" ,
2829 packages = ["grafana_api" ],
2930 install_requires = ["httpx" ],
3031 extras_require = {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def test_a_create_new_snapshot(self):
2121 self .dashboard .get_dashboard_by_uid ("tests" ).get ("dashboard" ),
2222 name = "TestSnapshot1" ,
2323 )
24- self .assertIsNotNone (snapshot .get ("id " ))
24+ self .assertIsNotNone (snapshot .get ("key " ))
2525
2626 def test_get_snapshots (self ):
2727 self .assertEqual (1 , len (self .snapshot .get_snapshots ()))
@@ -32,12 +32,13 @@ def test_get_snapshot_by_key(self):
3232 self .snapshot .get_snapshot_by_key (snapshot_key ).get ("dashboard" ).get ("id" )
3333 )
3434
35- def test_b_delete_snapshot_by_key (self ):
35+ def test_d_delete_snapshot_by_key (self ):
36+ print (self .snapshot .get_snapshots ())
3637 snapshot_key : str = self .snapshot .get_snapshots ()[1 ].get ("key" )
3738 self .snapshot .delete_snapshot_by_key (snapshot_key )
3839 self .assertEqual (1 , len (self .snapshot .get_snapshots ()))
3940
40- def test_c_delete_snapshot_by_delete_key (self ):
41+ def test_e_delete_snapshot_by_delete_key (self ):
4142 snapshot : dict = self .snapshot .create_new_snapshot (
4243 self .dashboard .get_dashboard_by_uid ("tests" ).get ("dashboard" ),
4344 name = "TestSnapshot2" ,
You can’t perform that action at this time.
0 commit comments