def test_pynast_suported_version(self):
        """pynast version is supported """
        min_acceptable_version = (1, 2)
        min_unacceptable_version = (1, 3)
        try:
            from pynast import __version__ as pynast_lib_version

            version = pynast_lib_version.split(".")
            if version[-1][-4:] == "-dev":
                version[-1] = version[-1][:-4]
            version = tuple(map(int, version))
            pass_test = version >= min_acceptable_version and version < min_unacceptable_version
            version_string = str(pynast_lib_version)
        except ImportError:
            pass_test = False
            version_string = "Not installed"
        self.assertTrue(
            pass_test,
            "Unsupported pynast version. Must be >= %s and < %s , but running %s."
            % (
                ".".join(map(str, min_acceptable_version)),
                ".".join(map(str, min_unacceptable_version)),
                version_string,
            ),
        )
Esempio n. 2
0
 def test_pynast_suported_version(self):
     """pynast version is supported """
     min_acceptable_version = (1,2)
     min_unacceptable_version = (1,3)
     try:
         from pynast import __version__ as pynast_lib_version
         version = pynast_lib_version.split('.')
         if version[-1][-4:]=='-dev':
              version[-1] = version[-1][:-4]
         version = tuple(map(int,version))
         pass_test = (version >= min_acceptable_version and version < min_unacceptable_version)
         version_string = str(pynast_lib_version)
     except ImportError:
         pass_test = False
         version_string = "Not installed"
     self.assertTrue(pass_test,\
      "Unsupported pynast version. Must be >= %s and < %s , but running %s." \
      % ('.'.join(map(str,min_acceptable_version)),
         '.'.join(map(str,min_unacceptable_version)),
         version_string))
 def test_pynast_suported_version(self):
     """pynast version is supported """
     min_acceptable_version = (1,1)
     min_unacceptable_version = (1,2)
     try:
         from pynast import __version__ as pynast_lib_version
         version = pynast_lib_version.split('.')
         if version[-1][-4:]=='-dev':
              version[-1] = version[-1][:-4]
         version = tuple(map(int,version))
         pass_test = (version >= min_acceptable_version and version < min_unacceptable_version)
         version_string = str(pynast_lib_version)
     except ImportError:
         pass_test = False
         version_string = "Not installed"
     self.assertTrue(pass_test,\
      "Unsupported matplotlib version. Must be >= %s and < %s , but running %s." \
      % ('.'.join(map(str,min_acceptable_version)),
         '.'.join(map(str,min_unacceptable_version)),
         version_string))
Esempio n. 4
0
    def test_pynast_suported_version(self):
        """pynast version is supported """
        min_acceptable_version = (1, 2)
        max_acceptable_version = (1, 2, 2)
        try:
            from pynast import __version__ as pynast_lib_version
            version = pynast_lib_version.split('.')
            if version[-1][-4:] == '-dev':
                version[-1] = version[-1][:-4]
            version = tuple(map(int, version))
            pass_test = (version >= min_acceptable_version and
                         version <= max_acceptable_version)
            version_string = str(pynast_lib_version)
        except ImportError:
            pass_test = False
            version_string = "Not installed"

        min_version_str = '.'.join(map(str, min_acceptable_version))
        max_version_str = '.'.join(map(str, max_acceptable_version))
        error_msg = ("Unsupported pynast version. Must be >= %s and <= %s, "
                     "but running %s." % (min_version_str, max_version_str,
                                          version_string))
        self.assertTrue(pass_test, error_msg)