Пример #1
0
 def test_as_ps_task_init(self):
     ps = PsCommand("Get-At-Me")
     task = ps.as_ps_task()
     self.assertEqual("ps", task["task_type"])
     self.assertEqual(False, task["completed"])
     self.assertEqual(0, task["progress"])
     self.assertEqual(None, task["state"])
     self.assertEqual("", task["status"])
     self.assertEqual(None, task["error"])
Пример #2
0
 def test_as_ps_task_completed(self):
     ps = PsCommand("Get-At-Me")
     ps.status = "completed"
     task = ps.as_ps_task()
     self.assertEqual("ps", task["task_type"])
     self.assertEqual(True, task["completed"])
     self.assertEqual(100, task["progress"])
     self.assertEqual("completed", task["state"])
     self.assertEqual("", task["status"])
     self.assertEqual(None, task["error"])
Пример #3
0
 def test_as_ps_task_failed(self):
     ps = PsCommand("Get-At-Me")
     ps.status = "failed"
     ps.error = "Oh noes"
     task = ps.as_ps_task()
     self.assertEqual("ps", task["task_type"])
     self.assertEqual(False, task["completed"])
     self.assertEqual(0, task["progress"])
     self.assertEqual("failed", task["state"])
     self.assertEqual("", task["status"])
     self.assertEqual("Oh noes", task["error"])