old_contents: # Copyright Hybrid Logic Ltd.  See LICENSE file for details.
  
  """
  Tests for ``flocker.common._release``.
  """
  from unittest import TestCase
  
  from ..release import rpm_version, make_rpm_version
  
  
  class MakeRpmVersionTests(TestCase):
      """
      Tests for ``make_rpm_version``.
      """
      def test_good(self):
          """
          ``make_rpm_version`` gives the expected ``rpm_version`` instances when
          supplied with valid ``flocker_version_number``s.
          """
          expected = {
              '0.1.0': rpm_version('0.1.0', '1'),
              '0.1.0-99-g3d644b1': rpm_version('0.1.0', '1.99.g3d644b1'),
              '0.1.1pre1': rpm_version('0.1.1', '0.pre.1'),
              '0.1.1': rpm_version('0.1.1', '1'),
              '0.2.0dev1': rpm_version('0.2.0', '0.dev.1'),
              '0.2.0dev2-99-g3d644b1': rpm_version('0.2.0', '0.dev.2.99.g3d644b1'),
              '0.2.0dev3-100-g3d644b2-dirty': rpm_version(
                  '0.2.0', '0.dev.3.100.g3d644b2.dirty'),
          }
          unexpected_results = []
          for supplied_version, expected_rpm_version in expected.items():
              actual_rpm_version = make_rpm_version(supplied_version)
              if actual_rpm_version != expected_rpm_version:
                  unexpected_results.append((
                      supplied_version,
                      actual_rpm_version,
                      expected_rpm_version
                  ))
  
          if unexpected_results:
              self.fail(unexpected_results)
  
      def test_non_integer_suffix(self):
          """
          ``make_rpm_version`` raises ``Exception`` when supplied with a version
          with a non-integer pre or dev suffix number.
          """
          exception = self.assertRaises(Exception, make_rpm_version, '0.1.2preX')
  
          self.assertEqual(
              u'Non-integer value "X" for "pre". Supplied version 0.1.2preX',
              unicode(exception)
          )
  
  
new_contents: # Copyright Hybrid Logic Ltd.  See LICENSE file for details.
  
  """
  Tests for ``flocker.common._release``.
  """
  
  from unittest import TestCase
  
  from ..release import rpm_version, make_rpm_version
  
  
  class MakeRpmVersionTests(TestCase):
      """
      Tests for ``make_rpm_version``.
      """
      def test_good(self):
          """
          ``make_rpm_version`` gives the expected ``rpm_version`` instances when
          supplied with valid ``flocker_version_number``s.
          """
          expected = {
              '0.1.0': rpm_version('0.1.0', '1'),
              '0.1.0-99-g3d644b1': rpm_version('0.1.0', '1.99.g3d644b1'),
              '0.1.1pre1': rpm_version('0.1.1', '0.pre.1'),
              '0.1.1': rpm_version('0.1.1', '1'),
              '0.2.0dev1': rpm_version('0.2.0', '0.dev.1'),
              '0.2.0dev2-99-g3d644b1': rpm_version('0.2.0', '0.dev.2.99.g3d644b1'),
              '0.2.0dev3-100-g3d644b2-dirty': rpm_version(
                  '0.2.0', '0.dev.3.100.g3d644b2.dirty'),
          }
          unexpected_results = []
          for supplied_version, expected_rpm_version in expected.items():
              actual_rpm_version = make_rpm_version(supplied_version)
              if actual_rpm_version != expected_rpm_version:
                  unexpected_results.append((
                      supplied_version,
                      actual_rpm_version,
                      expected_rpm_version
                  ))
  
          if unexpected_results:
              self.fail(unexpected_results)
  
      def test_non_integer_suffix(self):
          """
          ``make_rpm_version`` raises ``Exception`` when supplied with a version
          with a non-integer pre or dev suffix number.
          """
          with self.assertRaises(Exception) as exception:
              make_rpm_version('0.1.2preX')
  
          self.assertEqual(
              u'Non-integer value "X" for "pre". Supplied version 0.1.2preX',
              unicode(exception.exception)
          )
  
subject: return release to its original state