code
stringlengths
3
6.57k
client.calls.create(twiml=formatted, to = to_num, from_ = from_num)
print("Texting Phone Number: "+str(to_num)
print("Twilio is not configured properly. Please check your twilioConfig_default.py file.")
TestStep(unittest.TestCase)
setUp(self)
Context({"namespace": "namespace"})
generate_definition("vpc", 1)
test_status(self)
self.assertFalse(self.step.submitted)
self.assertFalse(self.step.completed)
self.step.submit()
self.assertTrue(self.step.submitted)
self.assertFalse(self.step.completed)
self.step.complete()
self.assertTrue(self.step.submitted)
self.assertTrue(self.step.completed)
TestPlan(unittest.TestCase)
setUp(self)
Context(self.environment)
_run_func(self, stack, **kwargs)
test_execute_plan(self)
Plan(description="Test", sleep_time=0)
range(5)
generate_definition("vpc", i, **overrides)
plan.execute()
self.assertEqual(self.count, 9)
self.assertEqual(len(plan.list_skipped()
mock.patch("stacker.plan.multiprocessing")
test_execute_plan_with_watchers(self, patched_multiprocessing)
mock.MagicMock()
Plan(description="Test", sleep_time=0, watch_func=watch_func)
range(5)
generate_definition("vpc", i, **overrides)
plan.execute()
self.assertEqual(self.count, 9)
self.assertEqual(len(plan.list_skipped()
self.assertEqual(patched_multiprocessing.Process()
patched_multiprocessing.Process()
test_step_must_return_status(self)
Plan(description="Test", sleep_time=0)
Stack(definition=generate_definition("vpc", 1)
mock.MagicMock()
self.assertRaises(ValueError)
plan.execute()
test_execute_plan_ensure_parallel_builds(self)
_run_func(stack, *args, **kwargs)
Stack(definition=generate_definition("vpc", 1)
generate_definition("web", 2, requires=[vpc_stack.fqn])
generate_definition("db", 3, requires=[vpc_stack.fqn])
Plan(description="Test", sleep_time=0)
plan._single_run()
self.assertFalse(web_step.submitted)
self.assertFalse(db_step.submitted)
self.assertTrue(parallel_success)
test_plan_wait_func_must_be_function(self)
self.assertRaises(ImproperlyConfigured)
Plan(description="Test", wait_func="invalid")
test_plan_steps_listed_with_fqn(self)
Plan(description="Test", sleep_time=0)
Stack(definition=generate_definition("vpc", 1)
plan.add(stack=stack, run_func=lambda x, y: (x, y)
plan.list_pending()
self.assertEqual(steps[0][0], stack.fqn)
test_execute_plan_wait_func_not_called_if_complete(self)
mock.MagicMock()
Plan(description="Test", wait_func=wait_func)
run_func(*args, **kwargs)
range(2)
Stack(definition=generate_definition("vpc", i)
plan.execute()
self.assertEqual(wait_func.call_count, 0)
test_reset_plan(self)
Plan(description="Test", sleep_time=0)
range(5)
generate_definition("vpc", i, **overrides)
plan.execute()
self.assertEqual(self.count, 9)
self.assertEqual(len(plan.list_skipped()
plan.reset()
self.assertEqual(len(plan.list_pending()
len(plan)
test_reset_after_outline(self)
Plan(description="Test", sleep_time=0)
range(5)
generate_definition("vpc", i, **overrides)
plan.outline()
self.assertEqual(len(plan.list_pending()
len(plan)
mock.patch("stacker.plan.os")
mock.patch("stacker.plan.open", mock.mock_open()
test_reset_after_dump(self, *args)
Plan(description="Test", sleep_time=0)
range(5)
generate_definition("vpc", i, **overrides)
plan.dump("test")
self.assertEqual(len(plan.list_pending()
len(plan)
html2text.HTML2Text()
Printer()
pd.DataFrame(data, columns=NAMES)