Skip to content

Commit

Permalink
upversion + coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherbjorn committed May 22, 2020
1 parent fd7ed7f commit 056b963
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dkbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _schema: https://static.datakortet.no/schema/dkbuild.schema.yaml
package:
name: ttcal
description: UNKNOWN
version: 1.0.6
version: 1.0.7
created: 2013

build:
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '1.0.6'
version = '1.0.7'
# The full version, including alpha/beta/rc tags.
release = '1.0.6'
release = '1.0.7'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import sys, os
import setuptools

version = '1.0.6'
version = '1.0.7'

DIRNAME = os.path.dirname(__file__)
description = open(os.path.join(DIRNAME, 'README.rst'), 'r').read()
Expand Down
7 changes: 7 additions & 0 deletions tests/test_addition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
import ttcal


def test_repr():
assert repr(ttcal.Period(months=1)) == "Period(1 months)"
assert repr(ttcal.Period(months=13)) == "Period(1 years, 1 months)"
assert repr(ttcal.Period(years=1, months=1)) == "Period(1 years, 1 months)"


def test_period_cmp():
assert ttcal.Period(months=5) == ttcal.Period(months=5)
assert not ttcal.Period(months=5) == ttcal.Period(months=4)
assert ttcal.Period(months=4) != ttcal.Period(months=5)
assert ttcal.Period(months=4) < ttcal.Period(months=5)
assert ttcal.Period(months=4) <= ttcal.Period(months=5)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_ttcal_month.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def test_qmp(months):
assert months[0] == date(2012, 4, 5)
assert not (months[1] == months[0])
# assert not (months[0] == 'foo')
assert ttcal.Month(2020, 2) == ttcal.Month(2020, 2)
assert ttcal.Month(2020, 2) != ttcal.Month(2020, 3)


def test_len(months):
Expand Down
2 changes: 1 addition & 1 deletion ttcal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""Date classes (originally from TikTok).
"""
__version__ = '1.0.6'
__version__ = '1.0.7'
from .day import Day, Days, Today
from .duration import Duration, Period
from .calfns import chop, isoweek
Expand Down
2 changes: 1 addition & 1 deletion ttcal/duration.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __add__(self, other):
def __eq__(self, other):
return self.months == other.months

def __neq__(self, other):
def __ne__(self, other):
return self.months != other.months

def __gt__(self, other):
Expand Down
4 changes: 3 additions & 1 deletion ttcal/month.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __call__(self, daynum=None):
return ttcal.Year().december(23)
"""
if daynum is None: # pragma:nocover
if daynum is None: # pragma: nocover
return self # for when django tries to do value = value() *sigh*
return Day(self.year, self.month, daynum)

Expand Down Expand Up @@ -296,6 +296,8 @@ def mark(self, d, value='mark', method='replace'):
day.mark += value
else:
day.mark = value
else: # pragma: nocover
pass

except KeyError: # pragma:nocover
pass
Expand Down

0 comments on commit 056b963

Please sign in to comment.