Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Make it completely pep8 compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
charlax committed Jan 20, 2014
1 parent f60ae65 commit 1bff4a0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tu:
py.test

lint:
flake8 charlatan --ignore=E501,E702
flake8 charlatan

coverage:
coverage run --source charlatan setup.py test
Expand Down
31 changes: 16 additions & 15 deletions charlatan/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

# Copyright (c) 2010-2013 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import sys

Expand Down
1 change: 0 additions & 1 deletion charlatan/fixture.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import functools
import importlib

from charlatan.file_format import RelationshipToken
Expand Down
1 change: 0 additions & 1 deletion charlatan/fixtures_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import print_function
import copy

from charlatan import _compat
from charlatan.depgraph import DepGraph
Expand Down
4 changes: 2 additions & 2 deletions charlatan/tests/test_depgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ def test_has_edge_between(self):
d.add_edge('c', 'd')
d.add_node('e')
assert d.has_edge_between('a', 'c')
assert not d.has_edge_between('c', 'a'), 'has_edge_between should not be commutative'
assert not d.has_edge_between('a', 'b'), 'has_edge_between should be edges, not paths'
assert not d.has_edge_between('c', 'a'), 'should not be commutative'
assert not d.has_edge_between('a', 'b'), 'should be edges, not paths'
assert not d.has_edge_between('e', 'd')
3 changes: 2 additions & 1 deletion charlatan/tests/test_relationships_without_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class TestRelationshipsWithoutModels(testing.TestCase,

def setUp(self):
self.fixtures_manager = FixturesManager()
self.fixtures_manager.load('./charlatan/tests/data/relationships_without_models.yaml')
self.fixtures_manager.load(
'./charlatan/tests/data/relationships_without_models.yaml')
self.init_fixtures()

def test_dictionaries_nest(self):
Expand Down
4 changes: 2 additions & 2 deletions charlatan/tests/test_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_install_fixtures(self):
self.assertEqual(len(fixtures), 2)

def test_install_all_fixtures(self):
"""install_all_fixtures should install all fixtures of the yaml file."""
"""Verify it installs all fixtures of the yaml file."""
self.uninstall_all_fixtures()

fixtures = self.install_all_fixtures()
Expand All @@ -66,7 +66,7 @@ def test_uninstall_fixture(self):
self.assertEqual(len(fixtures), 0)

def test_uninstall_fixtures(self):
"""uninstall_fixtures should return the list of uninstalled fixtures."""
"""Verify it returns the list of uninstalled fixtures."""
fixtures = self.uninstall_fixtures(('simple_dict', 'dict_with_nest'))
self.assertEqual(len(fixtures), 2)

Expand Down
3 changes: 2 additions & 1 deletion charlatan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def extended_timedelta(**kwargs):
days.append([number_of_days[k], kwargs.pop(k)])

if days:
add = int(functools.reduce(operator.add, itertools.starmap(operator.mul, days)))
add = int(functools.reduce(
operator.add, itertools.starmap(operator.mul, days)))
kwargs["days"] = kwargs.setdefault("days", 0) + add

return datetime.timedelta(**kwargs)
Expand Down

0 comments on commit 1bff4a0

Please sign in to comment.