Skip to content

Commit

Permalink
Merge pull request #96 from planetlabs/flake8-2.5.4-fixes
Browse files Browse the repository at this point in the history
flake8 2.5.4 fixes
  • Loading branch information
ischneider committed Feb 12, 2016
2 parents 36ecfd2 + 3ac2ed7 commit c5f113f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion planet/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def get_raw(self):
def _write(self, fp, callback):
total = 0
if not callback:
callback = lambda x: None
def noop(x):
pass
callback = noop
callback(self)
for chunk in self:
if self._cancel:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

def test_atomic_open(tmpdir):
outfile = str(tmpdir.join('foo'))
lsdir = lambda: os.listdir(str(tmpdir))

def lsdir():
return os.listdir(str(tmpdir))

def assert_content_is(expected):
with open(outfile, 'r') as fp:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ def stdin(content):

def test_read(tmpdir):
# no special files in arguments, expect what's been passed in
assert None == scripts.read(None)
assert None is scripts.read(None)
assert 'foo' == scripts.read('foo')
assert (1,) == scripts.read((1,))

# same but with split
assert None == scripts.read(None, split=True)
assert None is scripts.read(None, split=True)
assert ['foo'] == scripts.read('foo', split=True)
assert (1,) == scripts.read((1,), split=True)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

def test_geometry_from_json():
# base case, no geometry
assert None == utils.geometry_from_json({})
assert None is utils.geometry_from_json({})
# from an empty feature collection
collection = {'type': 'FeatureCollection', 'features': []}
assert None == utils.geometry_from_json(collection)
assert None is utils.geometry_from_json(collection)

# simple geometry, we're guessing by the type property w/ no further checks
geom = {'type': 'Polygon'}
Expand Down

0 comments on commit c5f113f

Please sign in to comment.