Skip to content

Commit

Permalink
Fixing Repo.state to return last_build_state reference.
Browse files Browse the repository at this point in the history
Also added a line to test state against last_build_state so coverage may be improved.
  • Loading branch information
menegazzo committed Aug 4, 2014
1 parent 8590861 commit 13e4681
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions travispy/_tests/test_travispy.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def test_repos(self, repo_slug):
assert hasattr(repo, 'last_build_duration')
assert hasattr(repo, 'last_build_started_at')
assert hasattr(repo, 'last_build_finished_at')
assert repo.state == repo.last_build_state


def test_user(self):
Expand Down
6 changes: 4 additions & 2 deletions travispy/entities/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class Repo(Stateful):
@property
def state(self):
'''
This property must be overiden as soon as support to load "lazy" information is implemented.
:class:`.Repo` state is given through ``last_build_state``.
.. seealso:: :class:`.Stateful` for ``state`` full documentation.
'''
return self.CREATED
return self.last_build_state

0 comments on commit 13e4681

Please sign in to comment.