Esempio n. 1
0
 def test__sdv4_date__pr(self):
     os.environ['SD_BUILD'] = '9999'
     os.environ['SD_PULL_REQUEST'] = '9'
     now = datetime.datetime.utcnow()
     expected = f'{str(now.year)[-2:]}.{now.month}.{os.environ["SD_BUILD"]}a{os.environ["SD_PULL_REQUEST"]}'
     version = str(VersionDateSDV4Build(ignore_meta_version=True, now=now))
     self.assertEqual(version, expected)
Esempio n. 2
0
 def test__sdv4_date__unset(self):
     self.delkeys(['SD_BUILD', 'SD_BUILD_ID', 'SD_PULL_REQUEST'])
     with self.assertRaises(VersionError):
         version = str(VersionDateSDV4Build(ignore_meta_version=True))