Ejemplo n.º 1
0
 def test_create_bad(self):
     cur = os.getenv("SERVICE_NOW_TOKEN")
     os.environ.pop("SERVICE_NOW_TOKEN")
     with self.assertRaises(Exception) as _:
         _ = service_now_client.ServiceNowClient()
     
     os.environ["SERVICE_NOW_TOKEN"] = cur 
Ejemplo n.º 2
0
 def test_create_task(self):
     snow_cli = service_now_client.ServiceNowClient()
     self.assertNotEqual(snow_cli, None)
     cr_id = snow_cli.create_change_request("us-south")
     self.assertNotEqual(cr_id, "")
     snow_cli.create_task(cr_id, {
         "shortdescription": "my test desc",
         "description": "my first task",
         "data": "WAHOO it worked"
     })
Ejemplo n.º 3
0
    def test_update_closenotes(self):
        snow_cli = service_now_client.ServiceNowClient()
        self.assertNotEqual(snow_cli, None)
        cr_id = snow_cli.create_change_request("us-south")
        self.assertNotEqual(cr_id, "")

        test_notes = "Phase 1, phase 2, Phase 3"
        snow_cli.close_change_request(cr_id, {"closenotes": test_notes})
        closed_cr = snow_cli.read_change_request(cr_id)
        self.assertEqual(test_notes, json.loads(closed_cr)["result"]["closenotes"])
Ejemplo n.º 4
0
 def test_create_good(self):
     snow_cli = service_now_client.ServiceNowClient()
     self.assertNotEqual(snow_cli, None)
Ejemplo n.º 5
0
 def test_close_cr_bad_id(self):
     snow_cli = service_now_client.ServiceNowClient()
     self.assertNotEqual(snow_cli, None)
     with self.assertRaises(Exception) as _:
         _ = snow_cli.close_change_request("kkkkaaasavvvv")
Ejemplo n.º 6
0
 def test_create_cr(self):
     snow_cli = service_now_client.ServiceNowClient()
     self.assertNotEqual(snow_cli, None)
     cr_id = snow_cli.create_change_request("us-south")
     self.assertNotEqual(cr_id, "")
     snow_cli.close_change_request(cr_id)