diff options
Diffstat (limited to 'linaropy/series.py')
-rw-r--r-- | linaropy/series.py | 242 |
1 files changed, 119 insertions, 123 deletions
diff --git a/linaropy/series.py b/linaropy/series.py index 6c16a9f..e1d435d 100644 --- a/linaropy/series.py +++ b/linaropy/series.py @@ -6,11 +6,7 @@ import string from collections import OrderedDict import copy -from vers import Spin -from vers import Rc -from vers import Vendor -from vers import Package -from vers import packageFromStr +from linaropy.vers import Spin, Rc, Vendor, Package, packageFromStr from datetime import datetime from dateutil.relativedelta import relativedelta @@ -106,7 +102,7 @@ class Series(object): raise TypeError('Series requires an input package.') elif isinstance(package, Package): self.package = package - elif isinstance(package, basestring): + elif isinstance(package, str): self.package = packageFromStr(package) else: # There can't be a defaut package because it requires a version. @@ -171,7 +167,7 @@ class Series(object): self.fmt['%R'] = None # Fill in the values. - for key in self.fmt.iterkeys(): + for key in self.fmt.keys(): self.update_fmtdict(key) def update_fmtdict(self, key): @@ -183,7 +179,7 @@ class Series(object): elif key == '.%L': # Only prepend '.' if there's actually a series label. label = self.serieslabel() - self.fmt['.%L'] = string.replace(label, '-', '.') + self.fmt['.%L'] = str.replace(label, '-', '.') return elif key == '%L': self.fmt['%L'] = self.serieslabel().strip('-') @@ -217,7 +213,7 @@ class Series(object): self.fmt['-%S'] = str(self.spin) elif key == '.%S': spin = str(self.spin) - self.fmt['.%S'] = string.replace(spin, '-', '.') + self.fmt['.%S'] = str.replace(spin, '-', '.') elif key == '%S': self.fmt['%S'] = str(self.spin).strip('-') elif key == '-%R': @@ -225,7 +221,7 @@ class Series(object): self.fmt['-%R'] = str(self.rc) elif key == '.%R': rc = str(self.rc) - self.fmt['.%R'] = string.replace(rc, '-', '.') + self.fmt['.%R'] = str.replace(rc, '-', '.') elif key == '%R': self.fmt['%R'] = str(self.rc).strip('-') else: @@ -304,21 +300,21 @@ class Series(object): # Iterate across the dictionary and for each key found replace the key # with the contents of the fmt dictionary. ret = format_spec - for key in self.fmt.iterkeys(): + for key in self.fmt.keys(): if key in ret: # Update the relevant keys everytime through because the user # might have changed things. self.update_fmtdict(key) replac = self.fmt[key] - ret = string.replace(ret, key, replac) + ret = str.replace(ret, key, replac) return ret def serieslabel(self): # Only the 'snapshot-' is used in a label. if self.seriestype == Series.series.index("snapshot"): - return u'-' + Series.series[self.seriestype] + return '-' + Series.series[self.seriestype] else: - return u'' + return '' def shorttype(self): return Series.series[self.seriestype] @@ -334,8 +330,8 @@ class Series(object): def label(self): label = str(self.vendor) + self.serieslabel() + \ - u'-' + str(self.package) - label = label + u'-' + self.date.strftime("%Y.%m") + '-' + str(self.package) + label = label + '-' + self.date.strftime("%Y.%m") label = label + str(self.spin) + str(self.rc) return label @@ -344,21 +340,21 @@ class Series(object): def get_dir(self): dirstr = self.package.version.strfversion("%M%m") - dirstr = dirstr + u'-' + self.date.strftime("%Y.%m") + dirstr = dirstr + '-' + self.date.strftime("%Y.%m") dirstr = dirstr + str(self.spin) dirstr = dirstr + str(self.rc) return dirstr def get_server(self): - namespace = u'snapshots' + namespace = 'snapshots' if self.seriestype == Series.series.index("release"): - namespace = u'releases' + namespace = 'releases' return namespace def get_namespace(self): - namespace = u'releases' + namespace = 'releases' if self.seriestype == Series.series.index("snapshot"): - namespace = u'snapshots' + namespace = 'snapshots' return namespace # TODO: Document what a conformant branch name looks like. @@ -373,16 +369,16 @@ class Series(object): ------------ string represensting the branch name. """ - branchname = u'' + branchname = '' if self.seriestype == Series.series.index("snapshot"): - branchname = branchname + u'snapshots/' + branchname = branchname + 'snapshots/' else: - branchname = branchname + u'releases/' + branchname = branchname + 'releases/' branchname = branchname + self.vendor.lower() - branchname = branchname + u'-' + \ + branchname = branchname + '-' + \ self.package.version.strfversion("%M%m") - branchname = branchname + u'-' + self.date.strftime("%Y.%m") + branchname = branchname + '-' + self.date.strftime("%Y.%m") branchname = branchname + str(self.spin) branchname = branchname + str(self.rc) @@ -415,7 +411,7 @@ def series_from_branchname(branch=None): releases/<foo>[!-rcN] """ logging.info("Branch is %s." % branch) - if not isinstance(branch, basestring): + if not isinstance(branch, str): raise TypeError( 'series_from_branchname requires a basestring as input') @@ -443,7 +439,7 @@ def series_from_branchname(branch=None): # raise ValueError("Couldn't parse a namespace from input string") # This will catch where there's a namespace/ but no right hand value after # the /. - if seriesstr == u'': + if seriesstr == '': raise ValueError( "Couldn't parse a series from input string. Missing a branch name.") @@ -451,7 +447,7 @@ def series_from_branchname(branch=None): # This might generate key errors, depending on whether anything can be # parsed from the right-hand values. values = seriesstr.split('-') - dictionary = dict(zip(keys, values)) + dictionary = dict(list(zip(keys, values))) # if there is no spin but there is an 'rcX' in the spin key:value pair # it means that there's really no spin but should be in the rc key:value @@ -484,7 +480,7 @@ def series_from_branchname(branch=None): if dictionary["date"]: datekeys = ['year', 'month', 'day'] datevalues = dictionary["date"].split('.') - datefields = dict(zip(datekeys, datevalues)) + datefields = dict(list(zip(datekeys, datevalues))) if "day" not in datefields: datefields["day"] = "15" seriesdate = datetime(int(datefields["year"]), int( @@ -550,7 +546,7 @@ def series_from_tag(tag=None): raise ValueError('series_from_tag requires a tag') # TODO Test this. - if not isinstance(tag, basestring): + if not isinstance(tag, str): raise TypeError('series_from_tag requires a basestring as input') # This is default, we'll replace with 'snapshots' if we detect that the @@ -561,7 +557,7 @@ def series_from_tag(tag=None): # to force conformance, i.e., remove "-snapshot", but record the # namespace as snapshots while we're at it. if "snapshot" in tag: - tag = string.replace(tag, "-snapshot", '') + tag = str.replace(tag, "-snapshot", '') namespace = "snapshots" # Now we're going to cheat and fabricate a false branchname. @@ -570,7 +566,7 @@ def series_from_tag(tag=None): # ... in which case we can reuse this function. return series_from_branchname(branchname) -from vers import versionFromStr +from linaropy.vers import versionFromStr class TestSeries(unittest.TestCase): @@ -826,130 +822,130 @@ class TestSeries(unittest.TestCase): # and then the same branch name recreated. def test_series_from_branchname(self): - branch2 = u'snapshots/linaro-5.3-2016.05-6' + branch2 = 'snapshots/linaro-5.3-2016.05-6' series2 = series_from_branchname(branch=branch2) self.assertEqual(series2.branchname(), - u'snapshots/linaro-5.3-2016.05-6') + 'snapshots/linaro-5.3-2016.05-6') - branch3 = u'snapshots/linaro-5.3-2016.05' + branch3 = 'snapshots/linaro-5.3-2016.05' series3 = series_from_branchname(branch=branch3) - self.assertEqual(series3.branchname(), u'snapshots/linaro-5.3-2016.05') + self.assertEqual(series3.branchname(), 'snapshots/linaro-5.3-2016.05') - branch4 = u'releases/linaro-5.3-2016.05-6-rc1' + branch4 = 'releases/linaro-5.3-2016.05-6-rc1' series4 = series_from_branchname(branch=branch4) self.assertEqual(series4.branchname(), - u'releases/linaro-5.3-2016.05-6-rc1') + 'releases/linaro-5.3-2016.05-6-rc1') - branch5 = u'releases/linaro-5.3-2016.05-rc1' + branch5 = 'releases/linaro-5.3-2016.05-rc1' series5 = series_from_branchname(branch=branch5) self.assertEqual(series5.branchname(), - u'releases/linaro-5.3-2016.05-rc1') + 'releases/linaro-5.3-2016.05-rc1') - branch6 = u'releases/linaro-5.3-2016.05-6' + branch6 = 'releases/linaro-5.3-2016.05-6' series6 = series_from_branchname(branch=branch6) self.assertEqual(series6.branchname(), - u'releases/linaro-5.3-2016.05-6') + 'releases/linaro-5.3-2016.05-6') - branch7 = u'releases/linaro-5.3-2016.05' + branch7 = 'releases/linaro-5.3-2016.05' series7 = series_from_branchname(branch=branch7) - self.assertEqual(series7.branchname(), u'releases/linaro-5.3-2016.05') + self.assertEqual(series7.branchname(), 'releases/linaro-5.3-2016.05') # -rc1 is invalid with a snapshots namespace. - branch8 = u'snapshots/linaro-5.3-2016.05-6-rc1' + branch8 = 'snapshots/linaro-5.3-2016.05-6-rc1' with self.assertRaises(ValueError): series8 = series_from_branchname(branch=branch8) # Wrong branchname.. it should be 'snapshots' - branch9 = u'snapshot/linaro-5.3-2016.05-6-rc1' + branch9 = 'snapshot/linaro-5.3-2016.05-6-rc1' with self.assertRaises(ValueError): series9 = series_from_branchname(branch=branch9) # Wrong branchname.. it should be 'snapshots' - branch10 = u'snapshot/linaro-5.3-2016.05-6' + branch10 = 'snapshot/linaro-5.3-2016.05-6' with self.assertRaises(ValueError): series10 = series_from_branchname(branch=branch10) # namespace required. - branch11 = u'linaro-5.3-2016.05-6' + branch11 = 'linaro-5.3-2016.05-6' with self.assertRaises(ValueError): series11 = series_from_branchname(branch=branch11) # it should complain about missing the right-hand values. - branch12 = u'snapshots/' + branch12 = 'snapshots/' with self.assertRaises(ValueError): series12 = series_from_branchname(branch=branch12) # It won't parse because of a missing namespace / - branch13 = u'snapshots' + branch13 = 'snapshots' with self.assertRaises(ValueError): series13 = series_from_branchname(branch=branch13) - branch14 = u'snapshots/foo' + branch14 = 'snapshots/foo' with self.assertRaises(KeyError): series14 = series_from_branchname(branch=branch14) # unknown namespace. - branch15 = u'foobarnamespace/linaro-5.3-2016.05-6' + branch15 = 'foobarnamespace/linaro-5.3-2016.05-6' with self.assertRaises(ValueError): series15 = series_from_branchname(branch=branch15) # This will fail on a non-datetime input. - branch16 = u'snapshots/linaro-5.3-asdf' + branch16 = 'snapshots/linaro-5.3-asdf' with self.assertRaises(ValueError): series16 = series_from_branchname(branch=branch16) # This will fail with an invalid spin. - branch17 = u'snapshots/linaro-5.3-2016.05-a' + branch17 = 'snapshots/linaro-5.3-2016.05-a' with self.assertRaises(TypeError): series17 = series_from_branchname(branch=branch17) # This will fail with an invalid rc. - branch18 = u'snapshots/linaro-5.3-2016.05-rcasdfn' + branch18 = 'snapshots/linaro-5.3-2016.05-rcasdfn' with self.assertRaises(TypeError): series18 = series_from_branchname(branch=branch18) # This will fail with an invalid rc. - branch19 = u'snapshots/linaro-5.3-2016.05-9-rcasdfn' + branch19 = 'snapshots/linaro-5.3-2016.05-9-rcasdfn' with self.assertRaises(TypeError): series19 = series_from_branchname(branch=branch19) # TODO: Test series.label (as there was a runtime bug) def test_snapshot_series_from_tag(self): - tag = u'linaro-snapshot-5.3-2016.05-6' + tag = 'linaro-snapshot-5.3-2016.05-6' series = series_from_tag(tag=tag) self.assertEqual(series.branchname(), - u'snapshots/linaro-5.3-2016.05-6') + 'snapshots/linaro-5.3-2016.05-6') def test_invalid_snapshot_series_from_tag(self): # We can't have -rc1 on a snapshot. - tag = u'linaro-snapshot-5.3-2016.05-6-rc1' + tag = 'linaro-snapshot-5.3-2016.05-6-rc1' with self.assertRaises(ValueError): series = series_from_tag(tag=tag) def test_candidate_series_from_tag(self): - tag = u'linaro-5.3-2016.05-6-rc1' + tag = 'linaro-5.3-2016.05-6-rc1' series = series_from_tag(tag=tag) self.assertEqual(series.branchname(), - u'releases/linaro-5.3-2016.05-6-rc1') + 'releases/linaro-5.3-2016.05-6-rc1') def test_release_series_from_tag(self): - tag = u'linaro-5.3-2016.05-6' + tag = 'linaro-5.3-2016.05-6' series = series_from_tag(tag=tag) - self.assertEqual(series.branchname(), u'releases/linaro-5.3-2016.05-6') + self.assertEqual(series.branchname(), 'releases/linaro-5.3-2016.05-6') def test_series_from_tag_invalid_spin(self): - tag = u'linaro-5.3-2016.05-abc' + tag = 'linaro-5.3-2016.05-abc' with self.assertRaises(TypeError): series = series_from_tag(tag=tag) def test_series_from_tag_invalid_rc(self): - tag = u'linaro-5.3-2016.05-rcabf' + tag = 'linaro-5.3-2016.05-rcabf' with self.assertRaises(TypeError): series = series_from_tag(tag=tag) def test_series_from_tag_invalid_rc_with_valid_spin(self): - tag = u'linaro-5.3-2016.05-9-rcabf' + tag = 'linaro-5.3-2016.05-9-rcabf' with self.assertRaises(TypeError): series = series_from_tag(tag=tag) @@ -958,153 +954,153 @@ class TestSeriesFormat(unittest.TestCase): @classmethod def setUpClass(cls): - snaptag = u'linaro-snapshot-5.3-2016.05-6' - reltag = u'linaro-5.3-2016.05-6' - rctag = u'linaro-5.3-2016.05-6-rc1' + snaptag = 'linaro-snapshot-5.3-2016.05-6' + reltag = 'linaro-5.3-2016.05-6' + rctag = 'linaro-5.3-2016.05-6-rc1' cls.snapseries = series_from_tag(tag=snaptag) cls.relseries = series_from_tag(tag=reltag) cls.rcseries = series_from_tag(tag=rctag) def test_format_N_snap(self): f = format(self.snapseries, '%N') - self.assertEquals(f, 'snapshots') + self.assertEqual(f, 'snapshots') def test_format_N_rel(self): f = format(self.relseries, '%N') - self.assertEquals(f, 'releases') + self.assertEqual(f, 'releases') def test_format_N_rc(self): f = format(self.rcseries, '%N') - self.assertEquals(f, 'releases') + self.assertEqual(f, 'releases') def test_format_dashL_snap(self): f = format(self.snapseries, 'foo-%L-bar') - self.assertEquals(f, 'foo-snapshot-bar') + self.assertEqual(f, 'foo-snapshot-bar') def test_format_dashL_rel(self): f = format(self.relseries, 'foo-%L-bar') - self.assertEquals(f, 'foo-bar') + self.assertEqual(f, 'foo-bar') def test_format_dashL_rc(self): f = format(self.rcseries, 'foo-%L-bar') - self.assertEquals(f, 'foo-bar') + self.assertEqual(f, 'foo-bar') def test_format_dotL_snap(self): f = format(self.snapseries, 'foo.%L.bar') - self.assertEquals(f, 'foo.snapshot.bar') + self.assertEqual(f, 'foo.snapshot.bar') def test_format_dotL_rel(self): f = format(self.relseries, 'foo.%L.bar') - self.assertEquals(f, 'foo.bar') + self.assertEqual(f, 'foo.bar') def test_format_dotL_rc(self): f = format(self.rcseries, 'foo.%L.bar') - self.assertEquals(f, 'foo.bar') + self.assertEqual(f, 'foo.bar') def test_format_L_snap(self): f = format(self.snapseries, 'foo%Lbar') - self.assertEquals(f, 'foosnapshotbar') + self.assertEqual(f, 'foosnapshotbar') def test_format_L_rel(self): f = format(self.relseries, 'foo%Lbar') - self.assertEquals(f, 'foobar') + self.assertEqual(f, 'foobar') def test_format_L_rc(self): f = format(self.rcseries, 'foo%Lbar') - self.assertEquals(f, 'foobar') + self.assertEqual(f, 'foobar') def test_format_dashP(self): f = format(self.snapseries, 'foo-%P-bar') - self.assertEquals(f, 'foo-GCC-bar') + self.assertEqual(f, 'foo-GCC-bar') def test_format_dotP(self): f = format(self.snapseries, 'foo.%P.bar') - self.assertEquals(f, 'foo.GCC.bar') + self.assertEqual(f, 'foo.GCC.bar') def test_format_P(self): f = format(self.snapseries, 'foo%Pbar') - self.assertEquals(f, 'fooGCCbar') + self.assertEqual(f, 'fooGCCbar') def test_format_dashl(self): f = format(self.snapseries, 'foo-%l-bar') - self.assertEquals(f, 'foo-gcc-bar') + self.assertEqual(f, 'foo-gcc-bar') def test_format_dotl(self): f = format(self.snapseries, 'foo.%l.bar') - self.assertEquals(f, 'foo.gcc.bar') + self.assertEqual(f, 'foo.gcc.bar') def test_format_l(self): f = format(self.snapseries, 'foo%lbar') - self.assertEquals(f, 'foogccbar') + self.assertEqual(f, 'foogccbar') def test_format_V(self): f = format(self.snapseries, 'foo.%V.bar') - self.assertEquals(f, 'foo.Linaro.bar') + self.assertEqual(f, 'foo.Linaro.bar') def test_format_v(self): f = format(self.snapseries, 'foo.%v.bar') - self.assertEquals(f, 'foo.linaro.bar') + self.assertEqual(f, 'foo.linaro.bar') def test_format_E(self): f = format(self.snapseries, 'gcc-%E') - self.assertEquals(f, 'gcc-5.3') + self.assertEqual(f, 'gcc-5.3') # This shouldn't show a trailing - after the minor because of a point. def test_format_E_with_fabricated_minor(self): minorseries = copy.deepcopy(self.snapseries) minorseries.package.version.point = 9 f = format(minorseries, 'gcc-%E') - self.assertEquals(f, 'gcc-5.3') + self.assertEqual(f, 'gcc-5.3') def test_format_e(self): f = format(self.snapseries, 'gcc-%e') - self.assertEquals(f, 'gcc-5.3') + self.assertEqual(f, 'gcc-5.3') def test_format_e_fabricate_minor(self): minorseries = copy.deepcopy(self.snapseries) minorseries.package.version.point = 9 f = format(minorseries, 'gcc-%e') - self.assertEquals(f, 'gcc-5.3.9') + self.assertEqual(f, 'gcc-5.3.9') def test_format_M(self): f = format(self.snapseries, 'gcc-%M') - self.assertEquals(f, 'gcc-5') + self.assertEqual(f, 'gcc-5') def test_format_m(self): f = format(self.snapseries, 'gcc-X.%m') - self.assertEquals(f, 'gcc-X.3') + self.assertEqual(f, 'gcc-X.3') def test_format_p(self): f = format(self.snapseries, 'gcc-X.Y.%p') - self.assertEquals(f, 'gcc-X.Y.') + self.assertEqual(f, 'gcc-X.Y.') def test_format_p_fabricate_minor(self): minorseries = copy.deepcopy(self.snapseries) minorseries.package.version.point = 9 f = format(minorseries, 'gcc-X.Y.%p') - self.assertEquals(f, 'gcc-X.Y.9') + self.assertEqual(f, 'gcc-X.Y.9') def test_format_D(self): f = format(self.snapseries, 'foo-%D-bar') - self.assertEquals(f, 'foo-2016.05-bar') + self.assertEqual(f, 'foo-2016.05-bar') def test_format_snap_h(self): f = format(self.snapseries, 'http://%h.') - self.assertEquals(f, 'http://snapshots.') + self.assertEqual(f, 'http://snapshots.') def test_format_release_h(self): f = format(self.relseries, 'http://%h.') - self.assertEquals(f, 'http://releases.') + self.assertEqual(f, 'http://releases.') def test_format_snap_h(self): f = format(self.snapseries, 'http://%h.') - self.assertEquals(f, 'http://snapshots.') + self.assertEqual(f, 'http://snapshots.') def test_format_snap_d(self): f = format( self.snapseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://snapshots.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6') @@ -1113,7 +1109,7 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.relseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://releases.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6') @@ -1122,7 +1118,7 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.rcseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://snapshots.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6-rc1') @@ -1131,7 +1127,7 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.snapseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://snapshots.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6') @@ -1140,7 +1136,7 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.relseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://releases.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6') @@ -1149,7 +1145,7 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.rcseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://snapshots.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6-rc1') @@ -1158,7 +1154,7 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.snapseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://snapshots.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6') @@ -1167,7 +1163,7 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.relseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://releases.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6') @@ -1176,70 +1172,70 @@ class TestSeriesFormat(unittest.TestCase): f = format( self.rcseries, 'http://%h.linaro.org/components/toolchain/binaries/%d') - self.assertEquals( + self.assertEqual( f, 'http://snapshots.linaro.org/components/' 'toolchain/binaries/5.3-2016.05-6-rc1') def test_format_dashS(self): f = format(self.snapseries, 'foo-%S-bar') - self.assertEquals(f, 'foo-6-bar') + self.assertEqual(f, 'foo-6-bar') def test_format_dashS_no_spin(self): nospinseries = copy.deepcopy(self.snapseries) nospinseries.spin = Spin() f = format(nospinseries, 'foo-%S-bar') - self.assertEquals(f, 'foo-bar') + self.assertEqual(f, 'foo-bar') def test_format_dotS(self): f = format(self.snapseries, 'foo.%S.bar') - self.assertEquals(f, 'foo.6.bar') + self.assertEqual(f, 'foo.6.bar') def test_format_dotS_no_spin(self): nospinseries = copy.deepcopy(self.snapseries) nospinseries.spin = Spin() f = format(nospinseries, 'foo.%S.bar') - self.assertEquals(f, 'foo.bar') + self.assertEqual(f, 'foo.bar') def test_format_S(self): f = format(self.snapseries, 'foo%Sbar') - self.assertEquals(f, 'foo6bar') + self.assertEqual(f, 'foo6bar') def test_format_S_no_spin(self): nospinseries = copy.deepcopy(self.snapseries) nospinseries.spin = Spin() f = format(nospinseries, 'foo%Sbar') - self.assertEquals(f, 'foobar') + self.assertEqual(f, 'foobar') def test_format_dashR(self): f = format(self.rcseries, '2016.05-6-%R') - self.assertEquals(f, '2016.05-6-rc1') + self.assertEqual(f, '2016.05-6-rc1') def test_format_dashR_fabricate_norc(self): norcseries = copy.deepcopy(self.rcseries) norcseries.rc = Rc() f = format(norcseries, '2016.05-6-%R') - self.assertEquals(f, '2016.05-6') + self.assertEqual(f, '2016.05-6') def test_format_dotR(self): f = format(self.rcseries, '2016.05-6.%R') - self.assertEquals(f, '2016.05-6.rc1') + self.assertEqual(f, '2016.05-6.rc1') def test_format_dotR_fabricate_norc(self): norcseries = copy.deepcopy(self.rcseries) norcseries.rc = Rc() f = format(norcseries, '2016.05-6.%R') - self.assertEquals(f, '2016.05-6') + self.assertEqual(f, '2016.05-6') def test_format_R(self): f = format(self.rcseries, '2016.05-6-%R') - self.assertEquals(f, '2016.05-6-rc1') + self.assertEqual(f, '2016.05-6-rc1') def test_format_R_fabricate_norc(self): norcseries = copy.deepcopy(self.rcseries) norcseries.rc = Rc() f = format(norcseries, '2016.05-6#%R') - self.assertEquals(f, '2016.05-6#') + self.assertEqual(f, '2016.05-6#') if __name__ == '__main__': # logging.basicConfig(level="INFO") |