from jawa.attribute import get_attribute_classes


def test_mandatory_attributes():
    for parser_class in get_attribute_classes().values():
        assert hasattr(parser_class, 'ADDED_IN'), (
            'Attribute parser missing mandatory ADDED_IN property'
        )
        assert hasattr(parser_class, 'MINIMUM_CLASS_VERSION'), (
            'Attribute parser missing mandatory MINIMUM_CLASS_VERSION '
            'property'
        )

from jawa.attribute import get_attribute_classes


def test_mandatory_attributes():
    required_properities = ['ADDED_IN', 'MINIMUM_CLASS_VERSION']
    for name, class_ in get_attribute_classes().items():
        for p in required_properities:
            assert hasattr(class_, p), (
                '{name} parser missing mandatory {p} property'.format(
                    name=name,
                    p=p
                )
            )


def test_attribute_naming():
    for name, class_ in get_attribute_classes().items():
        if hasattr(class_, 'ATTRIBUTE_NAME'):
            continue

        assert class_.__name__.endswith('Attribute'), (
            '{name} parser does not follow naming convention and does'
            ' not explicity set it.'.format(name=name)
        )

Add a simple test for Attribuet class naming conventions.
Add a simple test for Attribuet class naming conventions.

  from jawa.attribute import get_attribute_classes
  
  
  def test_mandatory_attributes():
+     required_properities = ['ADDED_IN', 'MINIMUM_CLASS_VERSION']
-     for parser_class in get_attribute_classes().values():
+     for name, class_ in get_attribute_classes().items():
-         assert hasattr(parser_class, 'ADDED_IN'), (
-             'Attribute parser missing mandatory ADDED_IN property'
+         for p in required_properities:
+             assert hasattr(class_, p), (
+                 '{name} parser missing mandatory {p} property'.format(
+                     name=name,
+                     p=p
+                 )
-         )
+             )
-         assert hasattr(parser_class, 'MINIMUM_CLASS_VERSION'), (
-             'Attribute parser missing mandatory MINIMUM_CLASS_VERSION '
-             'property'
+ 
+ 
+ def test_attribute_naming():
+     for name, class_ in get_attribute_classes().items():
+         if hasattr(class_, 'ATTRIBUTE_NAME'):
+             continue
+ 
+         assert class_.__name__.endswith('Attribute'), (
+             '{name} parser does not follow naming convention and does'
+             ' not explicity set it.'.format(name=name)
          )
  
Add a simple test for Attribuet class naming conventions.
## Code Before:
from jawa.attribute import get_attribute_classes


def test_mandatory_attributes():
    for parser_class in get_attribute_classes().values():
        assert hasattr(parser_class, 'ADDED_IN'), (
            'Attribute parser missing mandatory ADDED_IN property'
        )
        assert hasattr(parser_class, 'MINIMUM_CLASS_VERSION'), (
            'Attribute parser missing mandatory MINIMUM_CLASS_VERSION '
            'property'
        )

## Instruction:
Add a simple test for Attribuet class naming conventions.
## Code After:
from jawa.attribute import get_attribute_classes


def test_mandatory_attributes():
    required_properities = ['ADDED_IN', 'MINIMUM_CLASS_VERSION']
    for name, class_ in get_attribute_classes().items():
        for p in required_properities:
            assert hasattr(class_, p), (
                '{name} parser missing mandatory {p} property'.format(
                    name=name,
                    p=p
                )
            )


def test_attribute_naming():
    for name, class_ in get_attribute_classes().items():
        if hasattr(class_, 'ATTRIBUTE_NAME'):
            continue

        assert class_.__name__.endswith('Attribute'), (
            '{name} parser does not follow naming convention and does'
            ' not explicity set it.'.format(name=name)
        )
