def test_info_with_release_date_more_than_a_month_in_future(self): """The release date is ignored since it is too far in the future.""" today_plus_60_days = int( (datetime.today() + timedelta(days=60)).strftime("%s")) self.assertEqual( "OpenQuake version 0.3.2", version.info((0, 3, 2, today_plus_60_days)))
def test_info_with_data_not_a_tuple(self): """The version information is malformed (not in a tuple).""" self.assertEqual( "The OpenQuake version is not available.", version.info([2, -1, -1, -1]))
def test_info_with_datum_less_than_minus_one(self): """The version information is malformed (datum less than -1).""" self.assertEqual( "The OpenQuake version is not available.", version.info([2, -1, -1, -2]))
def test_info_with_data_not_integer(self): """The version information is malformed (non-integers).""" self.assertEqual( "The OpenQuake version is not available.", version.info(("2", "-1", "-1", "-1")))
def test_info_with_malformed_version_information(self): """The version information is malformed.""" self.assertEqual( "The OpenQuake version is not available.", version.info((-1,)))
def test_info_with_all_data_in_place(self): """All the version information is in place.""" self.assertEqual( "OpenQuake version 0.3.2, released 2011-04-08T06:04:11Z", version.info((0, 3, 2, 1302242651)))
def test_info_with_sprint_number_only(self): """Only the sprint number is set.""" self.assertEqual( "OpenQuake version 0.0.2", version.info((-1, -1, 2, -1)))
def test_info_with_minor_number_only(self): """Only the minor version number is set.""" self.assertEqual( "OpenQuake version 0.2.0", version.info((-1, 2, -1, -1)))