def test_set_not_complete_after_all_complete(self):
     directive = ComplexDirective()
     test_directive_name = 'ImmaComplexDirective'
     test_lines = [
         '<{name} some args >'.format(name=test_directive_name),
         'Redirect here there',
         '</{name}>'.format(name=test_directive_name),
     ]
     for test_line in test_lines:
         directive.add_line(test_line)
     with self.assertRaises(NodeCompleteError) as err:
         directive.complete = False
         expected_err_msg = "Cannot set a complex directive to not complete if its parts are all complete"
         self.assertIn(
             member=expected_err_msg,
             container=err,
             msg=
             'Expected "{}" in the raised InvalidLineError exception message, received: {}'
             .format(expected_err_msg, err),
         )
    def test_set_complete_after_all_complete(self):
        directive = ComplexDirective()
        test_directive_name = 'ImmaComplexDirective'
        test_lines = [
            '<{name} some args >'.format(name=test_directive_name),
            'Redirect here there',
            '</{name}>'.format(name=test_directive_name),
        ]
        for test_line in test_lines:
            directive.add_line(test_line)

        directive.complete = True

        expected = True
        actual = directive.complete
        self.assertEqual(
            first=expected,
            second=actual,
            msg='Expected complete property to be {}, received: {}'.format(
                expected, actual),
        )