def test_detect_current_version(self): with temp_directory(): with open('VERSION', 'w') as fp: fp.write('1.0.0\n') version = VersionFileReleaser().determine_current_version() self.assertEqual(version, Version('1.0.0'))
def test_determine_current_version(self): releaser = VersionFileReleaser() with temp_directory(): touch('VERSION', '0.2.6') version = releaser.determine_current_version() self.assertEqual(version, Version('0.2.6'))
def test_bumps_package_json(self): with temp_directory(): with open('VERSION', 'w') as fp: fp.write('1.0.0\n') VersionFileReleaser().bump('2.0.0') with open('VERSION') as fp: self.assertEqual(fp.read(), '2.0.0\n')
def test_bumps_version_file(self): releaser = VersionFileReleaser() with temp_directory(): touch('VERSION', '2.2.12') releaser.bump('2.3.0') with open('VERSION') as fp: self.assertEqual(fp.read(), '2.3.0\n')
def test_detects_version_file(self): with temp_directory(): touch('VERSION') self.assertTrue(VersionFileReleaser().detect())