# Path: awslimitchecker/version.py
# class AWSLimitCheckerVersion(object):
# 
#     def __init__(self, release, url, commit=None, tag=None):
#         self.release = release
#         self.url = url
#         self.commit = commit
#         self.tag = tag
# 
#     @property
#     def version_str(self):
#         """
#         The version string for the currently-running awslimitchecker;
#         includes git branch and tag information.
# 
#         :rtype: str
#         """
#         vs = str(self.release)
#         if self.tag is not None:
#             vs += '@{t}'.format(t=self.tag)
#         elif self.commit is not None:
#             vs += '@{c}'.format(c=self.commit)
#         return vs
# 
#     def __str__(self):
#         """
#         Human-readable string representation of this version object, in the
#         format: "version_str <url>"
# 
#         :rtype: str
#         """
#         return '{s} <{u}>'.format(
#             s=self.version_str,
#             u=self.url
#         )
# 
#     def __repr__(self):
#         """
#         Return a representation of this object that is valid Python and will
#         create an idential AWSLimitCheckerVersion object.
# 
#         :rtype: str
#         """
#         return 'AWSLimitCheckerVersion({r}, {u}, tag={t}, commit={c})'.format(
#             r=repr(self.release),
#             u=repr(self.url),
#             t=repr(self.tag),
#             c=repr(self.commit),
#         )


import awslimitchecker.version as version
import re
import sys
from awslimitchecker.version import AWSLimitCheckerVersion
from versionfinder.versioninfo import VersionInfo
from logging import CRITICAL
    from mock import patch, call, Mock
    from unittest.mock import patch, call, Mock
    def test_is_semver(self):
        # see:
        # https://github.com/mojombo/semver.org/issues/59#issuecomment-57884619
        semver_ptn = re.compile(
            r'^'
            r'(?P<MAJOR>(?:'
            r'0|(?:[1-9]\d*)'
            r'))'
            r'\.'
            r'(?P<MINOR>(?:'
            r'0|(?:[1-9]\d*)'
            r'))'
            r'\.'
            r'(?P<PATCH>(?:'
            r'0|(?:[1-9]\d*)'
            r'))'
            r'(?:-(?P<prerelease>'
            r'[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*'
            r'))?'
            r'(?:\+(?P<build>'
            r'[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*'
            r'))?'
            r'$'
        )
        assert semver_ptn.match(version._VERSION) is not None


class Test_AWSLimitCheckerVersionInfo(object):

    def test_simple(self):

# Path: awslimitchecker/version.py
# class AWSLimitCheckerVersion(object):
# 
#     def __init__(self, release, url, commit=None, tag=None):
#         self.release = release
#         self.url = url
#         self.commit = commit
#         self.tag = tag
# 
#     @property
#     def version_str(self):
#         """
#         The version string for the currently-running awslimitchecker;
#         includes git branch and tag information.
# 
#         :rtype: str
#         """
#         vs = str(self.release)
#         if self.tag is not None:
#             vs += '@{t}'.format(t=self.tag)
#         elif self.commit is not None:
#             vs += '@{c}'.format(c=self.commit)
#         return vs
# 
#     def __str__(self):
#         """
#         Human-readable string representation of this version object, in the
#         format: "version_str <url>"
# 
#         :rtype: str
#         """
#         return '{s} <{u}>'.format(
#             s=self.version_str,
#             u=self.url
#         )
# 
#     def __repr__(self):
#         """
#         Return a representation of this object that is valid Python and will
#         create an idential AWSLimitCheckerVersion object.
# 
#         :rtype: str
#         """
#         return 'AWSLimitCheckerVersion({r}, {u}, tag={t}, commit={c})'.format(
#             r=repr(self.release),
#             u=repr(self.url),
#             t=repr(self.tag),
#             c=repr(self.commit),
#         )


# Path: awslimitchecker/tests/test_version.py
import awslimitchecker.version as version
import re
import sys
from awslimitchecker.version import AWSLimitCheckerVersion
from versionfinder.versioninfo import VersionInfo
from logging import CRITICAL
    from mock import patch, call, Mock
    from unittest.mock import patch, call, Mock

    def test_is_semver(self):
        # see:
        # https://github.com/mojombo/semver.org/issues/59#issuecomment-57884619
        semver_ptn = re.compile(
            r'^'
            r'(?P<MAJOR>(?:'
            r'0|(?:[1-9]\d*)'
            r'))'
            r'\.'
            r'(?P<MINOR>(?:'
            r'0|(?:[1-9]\d*)'
            r'))'
            r'\.'
            r'(?P<PATCH>(?:'
            r'0|(?:[1-9]\d*)'
            r'))'
            r'(?:-(?P<prerelease>'
            r'[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*'
            r'))?'
            r'(?:\+(?P<build>'
            r'[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*'
            r'))?'
            r'$'
        )
        assert semver_ptn.match(version._VERSION) is not None


class Test_AWSLimitCheckerVersionInfo(object):

    def test_simple(self):

        x = AWSLimitCheckerVersion('1.0', 'foo')