Example #1
0
 def test_i_expect_the_result_is_more_and_equal_than_number_failure(self):
     step = MockedStep()
     step.context.stash = 1
     with self.assertRaises(AssertionError) as err:
         i_expect_the_result_is_operator_than_number(
             step, 'more and equal', 2)
     self.assertEqual(str(err.exception), '1 is not more and equal than 2')
Example #2
0
 def test_i_expect_the_result_is_operator_than_number_less(self):
     step = MockedStep()
     step.context.stash = {'values': 42}
     self.assertIsNone(i_expect_the_result_is_operator_than_number(step, 'less', 43))
     with self.assertRaises(AssertionError) as err:
         i_expect_the_result_is_operator_than_number(step, 'less', 41)
     self.assertEqual(str(err.exception), '42 is not less than 41')
Example #3
0
 def test_i_expect_the_result_is_operator_than_number_equal(self, *args):
     step = MockedStep()
     step.context.stash = {'values': 42}
     self.assertIsNone(i_expect_the_result_is_operator_than_number(step, 'equal', 42))
     with self.assertRaises(Failure) as err:
         i_expect_the_result_is_operator_than_number(step, 'equal', 41)
     self.assertTrue('42 is not equal to 41' in str(err.exception))
Example #4
0
 def test_i_expect_the_result_is_operator_than_number_more(self):
     step = MockedStep()
     step.context.stash = {'values': 42}
     self.assertIsNone(
         i_expect_the_result_is_operator_than_number(step, 'more', 41))
     with self.assertRaises(Failure) as err:
         i_expect_the_result_is_operator_than_number(step, 'more', 43)
     self.assertTrue('42 is not more than 43' in str(err.exception))
Example #5
0
 def test_i_expect_the_result_is_operator_than_number_more_and_equal(self):
     step = MockedStep()
     step.context.stash = {'values': 42}
     self.assertIsNone(i_expect_the_result_is_operator_than_number(step, 'more and equal', 42))
     self.assertIsNone(i_expect_the_result_is_operator_than_number(step, 'more and equal', 41))
     with self.assertRaises(AssertionError) as err:
         i_expect_the_result_is_operator_than_number(step, 'more and equal', 43)
     self.assertEqual(str(err.exception), '42 is not more and equal than 43')
Example #6
0
 def test_i_expect_the_result_is_less_and_equal_than_number_success(self):
     step = MockedStep()
     step.context.stash = 1
     self.assertIsNone(
         i_expect_the_result_is_operator_than_number(
             step, 'less and equal', 1))
     self.assertIsNone(
         i_expect_the_result_is_operator_than_number(
             step, 'less and equal', 2))
Example #7
0
 def test_i_expect_the_result_is_more_than_number_failure(self):
     step = MockedStep()
     step.context.stash = 1
     with self.assertRaises(AssertionError) as err:
         self.assertIsNone(
             i_expect_the_result_is_operator_than_number(step, 'more', 1))
     self.assertEqual(str(err.exception), '1 is not more than 1')
Example #8
0
 def test_i_expect_the_result_is_operator_than_number_resource_list_as_dict(
         self):
     step = MockedStep()
     step.context.stash.resource_list = None
     self.assertIsNone(
         i_expect_the_result_is_operator_than_number(
             step, 'operator', 'not_important'))
Example #9
0
 def test_i_expect_the_result_is_more_than_number_failure(self):
     step = MockedStep()
     step.context.stash = dict(values=3)
     with self.assertRaises(TerraformComplianceNotImplemented) as err:
         self.assertIsNone(
             i_expect_the_result_is_operator_than_number(
                 step, 'invalid operator', 1))
     self.assertTrue(
         'Invalid operator: invalid operator' in str(err.exception))
Example #10
0
 def test_i_expect_the_result_is_less_than_number_failure(self):
     step = MockedStep()
     step.context.stash = 1
     with self.assertRaises(AssertionError) as err:
         i_expect_the_result_is_operator_than_number(step, 'less', 1)
     self.assertEqual(str(err.exception), '1 is not less than 1')
Example #11
0
 def test_i_expect_the_result_is_more_than_number_success(self):
     step = MockedStep()
     step.context.stash = 1
     self.assertIsNone(
         i_expect_the_result_is_operator_than_number(step, 'more', 0))
Example #12
0
 def test_i_expect_the_result_is_invalid_operator_than_number_failure(self):
     step = MockedStep()
     step.context.stash = 1
     self.assertIsNone(
         i_expect_the_result_is_operator_than_number(
             step, 'invalid_operator', 0))